class Solution {
public:
    vector<int> getRow(int rowIndex) {
        vector<int> res(rowIndex + 1);
        res[0] = 1;
        for (int i = 1; i <= rowIndex; ++i) {
            for (int j = i; j >= 1; --j) {
                res[j] += res[j - 1];
            }
        }
        return res;
    }
};

相关文章:

  • 2022-12-23
  • 2021-04-28
  • 2021-04-17
  • 2021-09-19
  • 2022-01-18
  • 2021-06-22
  • 2021-10-02
  • 2021-09-12
猜你喜欢
  • 2021-07-20
相关资源
相似解决方案