Given the head of a linked list, remove the nth node from the end of the list and return its head.
Determine the number of nodes the nth position from the end of the list is from the start of the list. Keep track of the current node. Iterate through the linked list until the nth-1 spot is reached. Remove the node in front of the current node.
Number of nodes = size of list - n
Curr = head
While counter != number of nodes
Move curr
If there is no next: return null
Remove the nth node
For example: list = [1 --> 2 --> 3 --> 5], n = 2
Remove the nth/2nd from end value (3)
i = 0; curr = 1
i = 1; curr = 2
i = 2; curr = 3
Remove: list = [1 --> 2 --> 5]