算法精粹(algorithm-essentials)

感谢soulmachine@github提供内容
## Remove Duplicates from Sorted List II


### 描述

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.

For example,

Given `1->2->3->3->4->4->5`, return `1->2->5`.

Given `1->1->1->2->3`, return `2->3`.


### 分析




### 递归版

{% codesnippet "./code/remove-duplicates-from-sorted-list-ii-1."+book.suffix, language=book.suffix %}{% endcodesnippet %}


### 迭代版

{% codesnippet "./code/remove-duplicates-from-sorted-list-ii-2."+book.suffix, language=book.suffix %}{% endcodesnippet %}


### 相关题目

* [Remove Duplicates from Sorted List](remove-duplicates-from-sorted-list.md)