Practice Delete Node in a Linked List
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You receive a reference to a node in a singly linked list, but not the head of the list. All values are distinct, and the given node is guaranteed not to be the tail. Delete its value from the list: the resulting list must have one fewer node, and the values before and after the removed value must keep their original order. Deletion does not require freeing that particular node from memory. For custom tests, provide the entire list and a non-tail node from it; the driver passes that node to your function and checks the resulting list.
Source: Delete Node in a Linked List on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
head = [4,5,1,9], node = 5
[4,1,9]
# Example 2
head = [4,5,1,9], node = 1
[4,5,9]
Constraints
Related LeetCode Problems
Practice more problems similar to Delete Node in a Linked List.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.