/**
 Definition for singlylinked list.
 struct ListNode {

int val;

ListNode *next;

ListNode(int x) : val(x), next(NULL) {}
 };
/
class Solution {
public:
void deleteNode(ListNode node) {
//if(node==NULLnode>next==NULL) { delete node; }
ListNode* tmp=node>next;
node>next = tmp>next;
node>val = tmp>val;
delete tmp;
}
};
although the answer is correct, i'm confused with which node to delete? it seems that i delete the next node of the input node.