265bc3d8e99c82bf9b649e77b0bef5fe
(难度Easy) Problem 118. Pascal's Triangle(杨辉三角)

Pascal's Triangle

Difficulty

Easy

Description

Given a non-negative integer _numRows_ , generate the first _numRows_ of
Pascal 's triangle.


In Pascal's triangle, each number is the sum of the two numbers directly above
it.

Example:

Input: 5
Output:
[
     [1],
    [1,1],
   [1,2,1],
  [1,3,3,1],
 [1,4,6,4,1]
]

题意

题意很简单,生成一个帕斯卡三角,其实就是我们常说的杨辉三角。

给定一个整数n,然后生成对应行数的杨辉三角。

top Created with Sketch.