LeetCode第118题—杨辉三角—Python实现


title: LeetCode No.118

categories:

  • OJ
  • LeetCode

tags:

  • Programing
  • LeetCode
  • OJ

LeetCode第118题—杨辉三角

自己代码的开源仓库:click here 欢迎Star和Fork ?

题目描述

给定一个非负整数 numRows,生成杨辉三角的前 numRows 行。

figure.1

在杨辉三角中,每个数是它左上方和右上方的数的和。

示例:

输入: 5
输出:
[
     [1],
    [1,1],
   [1,2,1],
  [1,3,3,1],
 [1,4,6,4,1]
]

代码


版权声明:本文为qq_16184125原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。