---
# System prepended metadata

title: 0237. Delete Node in a Linked List
tags: [Leetcode, Linked List, Medium]

---

# 0237. Delete Node in a Linked List
###### tags: `Leetcode` `Medium` `Linked List`
Link: https://leetcode.com/problems/delete-node-in-a-linked-list/description/
## 思路
delete ```next```, instead of delete ```node```
then change the val of ```next``` to the value of ```node```
## Code
```java=
class Solution {
    public void deleteNode(ListNode node) {
        ListNode n = node.next;
        ListNode nn = n.next;
        node.next = nn;
        node.val = n.val;
    }
}
```