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

Posted StriveZs

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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]
]

代码

以上是关于LeetCode第118题—杨辉三角—Python实现的主要内容,如果未能解决你的问题,请参考以下文章