Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
简单模拟。
vector > generate(int numRows)
{
vector< vector >res;
for(int i=0; itmp;
res.push_back(tmp);
res[i].push_back(1);
int numCols=i+1;
for(int j=1; j