119. Pascal's Triangle II
Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal’s triangle.
In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown:
根据杨辉三角形的规则递归。
每次递归行数-1。
根据上一行的返回值,生成新行的列表,然后返回。
如果生成行数为0则返回{1}。
1 | class Solution { |
119. Pascal's Triangle II
https://xuanhe95.github.io/2022/04/18/119-Pascal-s-Triangle-II/