constant space solution to removeNthFromEnd