Remove All Duplicates From Sorted Linkedlist

easy
1. You are give a single sorted linkedlist of numbers. 
2. remove all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the remaning linked list.

Input Format

1->1->1->4->5->6->6->7->8->9->9->9->null

Output Format

4->5->7->8->null

Constraints

0 <= N <= 10^6

Notice


Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
12
1 1 1 4 5 6 6 7 8 9 9 9
Output
4 5 7 8 
Previous
Remove Duplicate From Sorted Linkedlist
Next
Segregate 01 Node Of Linkedlist Over Swapping Nodes

Related Questions