aboutsummaryrefslogtreecommitdiff
path: root/delete_node_link_list.cpp
blob: cefe9155b760852aff3f2968dda60d6a052368d4 (plain)
1
2
3
4
5
6
7
8
9
10
#include "leetcode.h"

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