Given the head node head of a singly linked list sorted in ascending order, remove every value that appears more than once so that only values that occur exactly once remain in the list. Return the head of the modified linked list.
Note: Nodes with duplicate values are removed entirely, not reduced to a single occurrence.
Constraints:
The number of nodes in the list is in the range
Node.val
The linked list is guaranteed to be sorted in ascending order.
Given the head node head of a singly linked list sorted in ascending order, remove every value that appears more than once so that only values that occur exactly once remain in the list. Return the head of the modified linked list.
Note: Nodes with duplicate values are removed entirely, not reduced to a single occurrence.
Constraints:
The number of nodes in the list is in the range
Node.val
The linked list is guaranteed to be sorted in ascending order.