head whose values are in non-decreasing order, so equal values sit next to each other.
Keep exactly one node from every run of equal values, so that each value appears in the list only once. The remaining nodes keep their order, so the list stays sorted.
Return the head of the resulting list.head=list_node([2, 2, 2, 5, 7, 7]) → [2, 5, 7]
The three 2s shrink to one, so do the two 7s; 5 appears once and stays as it is.
head=list_node([-3, 0, 4]) → [-3, 0, 4]
There are no repeats, so the list does not change.
head=list_node([]) → None
An empty list stays empty.
head=list_node([2, 2, 2, 5, 7, 7])
[2, 5, 7]
Run checks the first 3 tests in your browser. Submit checks all 113 tests on the server, hidden ones included.