class Solution {
public:
vector<int> getRow(int rowIndex) {
if (rowIndex == 0) {
return {1};
} else if (rowIndex == 1) {
return {1, 1};
} else {
vector<int> last = getRow(rowIndex - 1);
vector<int> res;
int size = last.size();
res.push_back(last[0]);
for (int i = 0; i < size - 1; i++) {
res.push_back(last[i] + last[i + 1]);
}
res.push_back(last[size - 1]);
return res;
}
}
};