What is wrong with my solution? Respond!


#1
RandomListNode * curr = A, * temp;
while(curr){
    temp = curr->next;
    curr->next = new RandomListNode(curr->label);
    curr->next->next = temp;
    curr = temp;
}
curr = A;
while(curr){
    
    if(curr->next){
        curr->next->random = curr->random->next;
        curr = curr->next->next;
    }
    curr = curr->next->next;
}
RandomListNode* original = A, *copy = A->next; 
  
// save the start of copied linked list 
temp = copy; 
  
// now separate the original list and copied list 
while (original && copy) 
{ 
    original->next = original->next->next; 
  
    copy->next = copy->next->next; 
    original = original->next; 
    copy = copy->next; 
} 
return temp;