mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
27 lines
596 B
HTML
27 lines
596 B
HTML
<p>编写代码,移除未排序链表中的重复节点。保留最开始出现的节点。</p>
|
||
|
||
<p> <strong>示例1:</strong></p>
|
||
|
||
<pre>
|
||
<strong> 输入</strong>:[1, 2, 3, 3, 2, 1]
|
||
<strong> 输出</strong>:[1, 2, 3]
|
||
</pre>
|
||
|
||
<p> <strong>示例2:</strong></p>
|
||
|
||
<pre>
|
||
<strong> 输入</strong>:[1, 1, 1, 1, 2]
|
||
<strong> 输出</strong>:[1, 2]
|
||
</pre>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ol>
|
||
<li>链表长度在[0, 20000]范围内。</li>
|
||
<li>链表元素在[0, 20000]范围内。</li>
|
||
</ol>
|
||
|
||
<p> <strong>进阶:</strong></p>
|
||
|
||
<p>如果不得使用临时缓冲区,该怎么解决?</p>
|