Algorithm · Pinterest · Easy
Problem Implement a function that removes a specified node from a singly linked list. The list's head is not provided; instead, your function receives the node that must be removed directly. The target node is guaranteed not to be the last node. The list contains at least two nodes, and every node stores a distinct value. Your implementation must run in O(1) time. Use the following call shape: Example The node containing 5 is removed, and the remaining nodes retain their…
Checking your access…