leetcode237

时间:2023-01-01 02:44:44
/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int x) { val = x; }
* }
*/
public class Solution {
public void DeleteNode(ListNode node) {
node.val = node.next.val;
node.next = node.next.next;
}
}

https://leetcode.com/problems/delete-node-in-a-linked-list/#/description

相关文章