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