Remove the N-th Node from the End

medium
Unit 18 · Linked Lists0/3 to milestone

Remove the n-th node from the end of a linked list in one pass and return the head. Use two pointers n nodes apart and a dummy head so removing the first node works too.

ListNode, from_list and to_list are provided.

#linked-lists#two-pointers2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Remove the N-th Node from the End · TechGradify