LC 237. Delete Node in a Linked List

Nilanjan Deb · April 5, 2020

This is my CPP solution.

class Solution {
public:
    void deleteNode(ListNode* node) {
        node->val = node->next->val;
        node->next = node->next->next;
    }
};


Dicussion Forum