学习目标:
每日一题-杨辉三角 II
学习内容:
给定一个非负索引 rowIndex,返回「杨辉三角」的第 rowIndex 行。
在「杨辉三角」中,每个数是它左上方和右上方的数的和。

解法:
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
dp = [1] + [0] * rowIndex
for i in range(1, rowIndex + 1):
for j in range(i, 0, -1):
dp[j] += dp[j - 1]
return dp
