Leetcode Algorithms -- Pascal's Triangle
Pascal’s Triangle (Easy)
Description
Given numRows, generate the first numRows of Pascal’s triangle.
1
2
3
4
5
6
7
8
9 Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
Analysis
简单递推
My Solution
1 | //C++ |
Given numRows, generate the first numRows of Pascal’s triangle.
1
2
3
4
5
6
7
8
9 Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
简单递推
1 | //C++ |