Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given
Given
Given
1->1->2, return 1->2.Given
1->1->2->3->3, return 1->2->3.
Solution: my answer might not be optimized, using the most straightforward implementation in my mind...
The following code passes LeetCode Online Large Judge.
2013-05-28 redo, BUG FREE
Comments
Post a Comment