formula: https://en.wikipedia.org/wiki/Pascal's_triangle#Calculating_a_row_or_diagonal_by_itself

```
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> row(rowIndex+1);
row[0] = row[rowIndex] = 1;
for(int i = 1, j = rowIndex - 1; i <= j; ++i, --j)
row[j] = row[i] = (long)row[i-1]*(j+1)/i;
return row;
}
};
```