Leetcode 119. Pascal's Triangle II | | Leetcode 119. Pascal's Triangle II 文章作者:Tyan博客:noahsnail.com | CSDN | 简书 1. Description 2. Solution123456789101112class Solution {public: vector<int> getRow(int rowIndex) { vector<int> result(rowIndex + 1, 1); for(int i = 0; i < rowIndex + 1; i++) { for(int j = i - 1; j > 0; j--) { result[j] += result[j - 1]; } } return result; }}; Reference https://leetcode.com/problems/pascals-triangle-ii/description/ 如果有收获,可以请我喝杯咖啡! 赏 微信打赏 支付宝打赏