83 删除排序链表中的重复元素

      ListNode *deleteDuplicates(ListNode *head) {
        if (head == nullptr || head->next == nullptr)
            return head;
        ListNode *temp = head;
        int save = temp->val;
        while (temp->next) {
            if (temp->next->val == save)
                temp->next = temp->next->next;
            else {
                save = temp->next->val;
                temp = temp->next;
            }
        }
        return head;
    }
原文地址:https://www.cnblogs.com/INnoVationv2/p/10176144.html