3ms C


  • 0
    K

    struct ListNode* deleteDuplicates(struct ListNode* head) {
    struct ListNode* p;
    struct ListNode* q;
    p=head;
    while(p)
    {
    if(p->next->val=p->val)
    {
    q=p->next;
    p->next=p->next->next;
    free(q);
    }
    p=p->next;
    }
    return head;
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.