83. Remove Duplicates from Sorted List - cocoder39/coco39_LC GitHub Wiki

83. Remove Duplicates from Sorted List

ListNode* deleteDuplicates(ListNode* head) {
        ListNode* cur=head;
        while(cur && cur->next){
            cur->val == cur->next->val ? cur->next = cur->next->next : cur = cur->next;
        }
        return head;
    }