```
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> result;
vector<int> row = {1, 0};
for (int i = 0; i < numRows; ++i) {
transform(row.begin(), prev(row.end()), next(row.begin()),
row.begin(), plus<int>());
result.push_back(vector<int>(row.begin(), prev(row.end())));
row.insert(row.begin(), 0);
}
return result;
}
};
```

The values of `row`

after being `transform`

ed in each iteration are as follows:

0: `{1, 0}`

---`{0, 1, 0}`

1: `{1, 1, 0}`

---`{0, 1, 1, 0}`

2: `{1, 2, 1, 0}`

---`{0, 1, 2, 1, 0}`

3: `{1, 3, 3, 1, 0}`

---`{0, 1, 3, 3, 1, 0}`

...