119.Pascal's Triangle II

class Solution:
    def getRow(self, rowIndex: int) -> List[int]:
        ans = [1]
        for i in range(rowIndex + 1):
            tmp = [1 for i in range(i + 1)]
            for j in range(1, i):
                tmp[j] = ans[j-1] + ans[j]
            ans = tmp
        return ans
原文地址:https://www.cnblogs.com/luo-c/p/12857346.html