Given an indexk, return thekthrow of the Pascal's triangle.
class Solution {
public:
vector<int> getRow(int rowIndex) {
// if(rowIndex == 0) return vector<int>(1,1);
vector<int> res(rowIndex+1,0);
for(int i=0;i<rowIndex+2;i++){
if(i == 0) res[0] = 1;
else{
for(int j = i; j>=0; j--){
if(j == i || j == 0) res[j] == 1;
else res[j] = res[j]+res[j-1];
}
}
}
return res;
}
};