问题链接
https://leetcode.cn/problems/pascals-triangle-ii/description/
解题思路
没啥好说的,跟118没区别。
代码
class Solution: def getRow(self, rowIndex: int) -> List[int]: res = [1] for i in range(2, rowIndex+2): cur_res = [1 for j in range(i)] for j in range(1, len(cur_res)-1): cur_res[j] = res[j-1]+res[j] res = cur_res return res
标签:cur,int,res,II,range,杨辉三角,119 From: https://www.cnblogs.com/bjfu-vth/p/17053822.html