735. Remove Duplicates from Sorted List
Given the head of a sorted linked list, remove all duplicate elements so that each element appears only once. Return the updated linked list, which should also be sorted.
The input consists of an integer n, representing the number of nodes in the linked list. This is followed by n integers, representing the values of the nodes in the linked list.
Print the updated linked list.
4 1 1 2 2
The number of nodes in the linked list is between 0 and 300, inclusive. Each node's value is an integer between -100 and 100. The linked list is guaranteed to be sorted in ascending order.