mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part6
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<p>给定一个非负索引 <code>rowIndex</code>,返回「杨辉三角」的第 <code>rowIndex</code><em> </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> rowIndex = 3
|
||||
<strong>输出:</strong> [1,3,3,1]
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> rowIndex = 0
|
||||
<strong>输出:</strong> [1]
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> rowIndex = 1
|
||||
<strong>输出:</strong> [1,1]
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= rowIndex <= 33</code></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>进阶:</strong></p>
|
||||
|
||||
<p>你可以优化你的算法到 <code><em>O</em>(<i>rowIndex</i>)</code> 空间复杂度吗?</p>
|
Reference in New Issue
Block a user