19 - Hard - Remove Nth Node From End of List
- Find the (n + 1)-th node from the end of list:
- Create 2 pointers, p1 and p2;
- Move p2 forward by n + 1 steps;
- Move p1 and p2 simultaneously until p2 reaches the end of the list.
- At this point, p1 should point to the (n + 1)-th node from the end of the list. To delete the n-th node from the end of the list, point p1's next pointer to the one after p1.next.