function deleteDuplicates(head){
let current = head;
while(current && current.next){
if(current.val === current.next.val) current.next = current.next.next;
else current = current.next;
}
return head;
}
Explanation: Iterate through the list, if current node value equals next node value, skip the next node.
β± O(n) | πΎ O(1)