class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>>result;
for(int i = 0;i<numRows;i++)
{
vector<int>nums;
if(i == 0)
{
nums.push_back(1);
}
else
{
vector<int>be = result[i-1];
nums.push_back(1);
for(int row = 1;row<i;row++)
{
nums.push_back(be[row-1]+be[row]);
}
nums.push_back(1);
}
result.push_back(nums);
}
return result;
}
};