82. Remove Duplicates from Sorted List II
2019-06-05
82. 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.
Example 1:
1 | Input: 1->2->3->3->4->4->5 |
Example 2:
1 | Input: 1->1->1->2->3 |
Code:
1 | # Definition for singly-linked list. |