Given only access to a non-tail node, remove it from the singly linked list.
Constraints
Example
>>> head = ListNode(1, ListNode(2, ListNode(3, ListNode(4)))) >>> node = head.next.next # node with value 3 >>> delete_node(node) >>> # list becomes 1 -> 2 -> 4 >>> to_list(head) [1, 2, 4]
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints