1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
void deleteNode(struct ListNode* node) {
struct ListNode* temp = node->next;
node->val = node->next->val;
node->next = node->next->next;
free(temp);
}