class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> v(rowIndex+1);
v[0]=1;
for(int i=1;i<=rowIndex;i++)
for(int j=i+1;j>0;j--)
v[j]=v[j]+v[j-1];
return v;
}
};
119. Pascal's Triangle II
最新推荐文章于 2024-01-06 10:33:41 发布
