1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/杨辉三角 [pascals-triangle].html
2022-03-29 12:43:11 +08:00

30 lines
720 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给定一个非负整数 <em><code>numRows</code></em>生成「杨辉三角」的前 <em><code>numRows</code> </em>行。</p>
<p><small>在「杨辉三角」中,每个数是它左上方和右上方的数的和。</small></p>
<p><img alt="" src="https://pic.leetcode-cn.com/1626927345-DZmfxB-PascalTriangleAnimated2.gif" /></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> numRows = 5
<strong>输出:</strong> [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> numRows = 1
<strong>输出:</strong> [[1]]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= numRows <= 30</code></li>
</ul>