```
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> v(rowIndex+1);
int i,j,k;
if(rowIndex == 0)
return {1};
v[0] = 1;
for(i=1;i<=rowIndex;i++){
k = 1;
for(j=1;j<i;j++){
int temp = v[j];
v[j] = v[j] + k;
k = temp;
}
v[j] = 1;
}
return v;
}
```

};