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