Given a linked list, remove the nth node from the end and return the head. Do it in one pass.
# 1 → 2 → 3 → 4 → 5, n = 2
# Remove 4 (2nd from end)
# Result: 1 → 2 → 3 → 5
The trick: use two pointers with a gap of n nodes between them. When the fast pointer reaches the end, the slow pointer is right before the node to remove.
📋 Instructions
Implement `remove_nth_from_end(head, n)` using the two-pointer gap technique.
Remove the 2nd node from the end of [1,2,3,4,5] and print the result.
Create dummy→head. Move fast n+1 steps from dummy. Then move both until fast is None. Set slow.next = slow.next.next. Return dummy.next.