135. Remove Duplicates From a Sorted List
The list is already sorted in non-decreasing order.
Remove every repeated node so that each value appears once, and print what remains.
Print Empty for an empty list.
Because the list is sorted, equal values sit next to each other, you never need to look further back than the node you just kept.
Constraints - `0 ≤ n ≤ 100000` - `-1000000 ≤ value ≤ 1000000` - The values are sorted ascending.
Input
The first line contains an integer n, the number of nodes.
The second line contains n space-separated integers, the node values from head to tail, sorted in non-decreasing order.
The starter code builds the list for you; work on the nodes, not the array.
Output
Print the resulting list from head to tail on ONE line, separated by single spaces, or Empty if no nodes remain.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.