0019. Remove Nth Node From End of List

Interactive visualization of Two-Pass and One-Pass Two-Pointer approaches

Two-Pass
One-Pass Two Pointers
Presets:
Step 0 / 0
Ready
Click Play or Step to begin. First pass counts the list length, second pass finds and removes the target node.
Counting (Pass 1)
Current (Pass 2)
Target to Remove
Step 0 / 0
Ready
Click Play or Step to begin. Fast pointer advances n+1 steps, then both move together until fast reaches null.
Fast Pointer
Slow Pointer
Target to Remove