LeetCode #83 Remove Duplicates from Sorted List
var deleteDuplicates = function(head) {
if (!head) return null;
let prev = head, next = head.next;
while (next) {
if (prev.val === next.val) {
prev.next = next.next;
} else {
prev = prev.next;
}
next = next.next;
}
return head;
};
100% 이해 못함...
다시 보자 보자 보자