mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
43 lines
1.5 KiB
HTML
43 lines
1.5 KiB
HTML
<p>给你一个列表 <code>nums</code> ,里面每一个元素都是一个整数列表。请你依照下面各图的规则,按顺序返回 <code>nums</code> 中对角线上的整数。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/04/23/sample_1_1784.png" style="height: 143px; width: 158px;"></strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [[1,2,3],[4,5,6],[7,8,9]]
|
||
<strong>输出:</strong>[1,4,2,7,5,3,8,6,9]
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/04/23/sample_2_1784.png" style="height: 177px; width: 230px;"></strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [[1,2,3,4,5],[6,7],[8],[9,10,11],[12,13,14,15,16]]
|
||
<strong>输出:</strong>[1,6,2,8,7,3,9,4,12,10,5,13,11,14,15,16]
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [[1,2,3],[4],[5,6,7],[8],[9,10,11]]
|
||
<strong>输出:</strong>[1,4,2,5,3,8,6,9,7,10,11]
|
||
</pre>
|
||
|
||
<p><strong>示例 4:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>nums = [[1,2,3,4,5,6]]
|
||
<strong>输出:</strong>[1,2,3,4,5,6]
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= nums.length <= 10^5</code></li>
|
||
<li><code>1 <= nums[i].length <= 10^5</code></li>
|
||
<li><code>1 <= nums[i][j] <= 10^9</code></li>
|
||
<li><code>nums</code> 中最多有 <code>10^5</code> 个数字。</li>
|
||
</ul>
|