Swap kth-from-end node with head | Amplitude Interview Question