- It’s a 2-pointer question, but needs a little trick.
- Need a little
dummyto deal with situations when we want to remove
fastpointer move n steps beforehand, then
null, the next of
slow.nextis the target that we want!
Given the head of a linked list, remove the nth node from the end of the list and return its head.
Input: head = [1,2,3,4,5], n = 2