237 Delete Node in a Linked List – Easy
Problem:
Thoughts:
Solutions:
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
public class Solution {
public void deleteNode(ListNode node) {
node.val = node.next.val;
node.next = node.next.next;
}
}Previous236 Lowest Common Ancestor of a Binary Tree – MediumNext238 Product of Array Except Self – Medium
Last updated