LeetCode 119. Pascal's Triangle II Posted on 2021-02-12 Edited on 2024-11-24 In LeetCode 12345678910class Solution {public: vector<int> getRow(int rowIndex) { vector<int> row(rowIndex + 1); row[0] = 1; for (int i = 1; i <= rowIndex; ++i) row[i] = 1LL * row[i - 1] * (rowIndex - i + 1) / i; return row; }};