O(k)空间O(k2)时间
class Solution { public: vector<int> getRow(int rowIndex) { //O(k)空间 vector<int> res; if(rowIndex<0) return res; res.push_back(1); for(int i=1;i<=rowIndex;i++){ res.push_back(0); int a=0,b=0; for(int i=0;i<res.size();i++){ a=b,b=res[i]; res[i]=a+b; } } return res; } };