1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<p>给定一个链表,删除链表的倒数第&nbsp;<code>n</code><em>&nbsp;</em>个结点,并且返回链表的头结点。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg" style="width: 542px; height: 222px;" /></p>
<pre>
<strong>输入:</strong>head = [1,2,3,4,5], n = 2
<strong>输出:</strong>[1,2,3,5]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>head = [1], n = 1
<strong>输出:</strong>[]
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>head = [1,2], n = 1
<strong>输出:</strong>[1]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>链表中结点的数目为 <code>sz</code></li>
<li><code>1 &lt;= sz &lt;= 30</code></li>
<li><code>0 &lt;= Node.val &lt;= 100</code></li>
<li><code>1 &lt;= n &lt;= sz</code></li>
</ul>
<p>&nbsp;</p>
<p><strong>进阶:</strong>能尝试使用一趟扫描实现吗?</p>
<p>&nbsp;</p>
<p><meta charset="UTF-8" />注意:本题与主站 19&nbsp;题相同:&nbsp;<a href="https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/">https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/</a></p>