Problem
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
Examples
1 | Input: 1->2->3->3->4->4->5 |
Solution
Method:
Time Complexity:
Space Complexity:
1 | # Definition for singly-linked list. |
Note
Beware of the continuous duplicates