Approach Summary
Two pointers: advance fast by n+1 steps, then move both until fast is null. Slow is one before the target; relink to skip it.
How to Recognize This Pattern
- "Remove nth from end in one pass"
- Offset two pointers by n to land at the right node
Complexity Analysis
Time Complexity
O(n)
Space Complexity
O(1)
Tags
Linked List Two Pointers