119. Pascal's Triangle II
Input: 3
Output: [1,3,3,1]解题要点:
class Solution(object):
def getRow(self, rowIndex):
"""
:type rowIndex: int
:rtype: List[int]
"""
res = [0] * (rowIndex + 1)
res[0] = 1
for i in range(1, rowIndex+1):
for j in range(i, 0, -1):
res[j] += res[j-1]
return resLast updated
