LeetCode 237 Delete Node in a Linked List
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ void deleteNode(struct ListNode* node) { if(node==NULL || node->next==NULL) return; node->val = node->next->val; node->next = node->next->next; }