Leetcode 109

//这种也是空间复杂度为O(K)的解法,就是边界有点难写
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> res;
res.push_back();
if(rowIndex == ) return res;
res.push_back();
if(rowIndex == ) return res;
for(int i=;i <= rowIndex;i++){
res.push_back();
int a = res[];
int b = res[];
for(int j=;j < i;j++){
res[j] = a+b;
a = b;
b = res[j+];
}
res[i] = ;
}
return res;
}
};
上一篇:不同版本的SQL Server之间数据导出导入的方法及性能比较


下一篇:在SQL Server中将数据导出为XML和Json