Given the head of a sorted singly linked list, delete all duplicates such that each element appears only once. Return the head of the sorted linked list.
The list is guaranteed to be sorted in non-decreasing order.
Input: Head of a sorted singly linked list.
Output: Head of the deduplicated sorted linked list.
Input: [1,1,2]
Output: [1,2]
Explanation: node(1)→node(1)→node(2): skip second 1. node(1).next = node(2). Return [1,2].Input: [1,1,2,3,3]
Output: [1,2,3]
Explanation: Skip duplicate 1 and duplicate 3. Result: [1,2,3].Input: [1,2,3]
Output: [1,2,3]
Explanation: No duplicates. Return list unchanged.0 <= number of nodes <= 300-100 <= Node.val <= 100List is sorted in non-decreasing order