Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
分析
题目的意思是,给定一个整数N,输出N行的Pascal Triangle。
* 一道简单的模拟生成题,单纯的程序设计,没有什么算法牵扯。
* 需要注意的是,当输入为0, 1, 2,的时候。
Code