Why Runtime Error :Last executed input: {-1,1,#,#}?


  • 0
    C
    p = head;
    while(p){
        if(p->random != NULL) {
            p->next->random = p->random->next;
        }
        p = p->next->next;
    }
    
    p = head->next;
    while(p->next){
        p->next = p->next->next;
        p = p->next->next;
    }
    
    return head->next;

Log in to reply
 

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