c++


  • 0
    class Solution {
    public:
        void deleteNode(ListNode* node) {
            ListNode *temp=node,*second;
            if(temp->next)
            {
              second     = temp->next;
              temp->val  = temp->next->val;
              temp->next = temp->next->next;
              free(second);
            }
        }
    };
    

Log in to reply
 

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