```
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> res;
if (numRows <=0) {return res;}
else {
for (int i= 0; i<= numRows-1; i++) {
res[i][0] = 1;
for (int j = 1;j < i; j++) {
res[i][j]=res[i-1][j-1]+res[i-1][j];
}
res[i][i]=1;
}
return res;
}
}
};
```