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)/训练计划 III [fan-zhuan-lian-biao-lcof].html
2023-12-09 18:53:53 +08:00

44 lines
1009 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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>给定一个头节点为 <code>head</code> 的单链表用于记录一系列核心肌群训练编号,请将该系列训练编号 <strong>倒序</strong> 记录于链表并返回。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>head = [1,2,3,4,5]
<strong>输出:</strong>[5,4,3,2,1]
</pre>
<p>&nbsp;</p>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>head = [1,2]
<strong>输出:</strong>[2,1]
</pre>
<p>&nbsp;</p>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>head = []
<strong>输出:</strong>[]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>链表中节点的数目范围是 <code>[0, 5000]</code></li>
<li><code>-5000 &lt;= Node.val &lt;= 5000</code></li>
</ul>
<p>&nbsp;</p>
<p><strong>注意</strong>:本题与主站 206 题相同:<a href="https://leetcode-cn.com/problems/reverse-linked-list/">https://leetcode-cn.com/problems/reverse-linked-list/</a></p>
<p>&nbsp;</p>