Given the head of a singly linked list and an integer n, remove the nth node from the end of the list and return its head.
n is always valid. Use one-pass two-pointer technique.
Input: Head of a singly linked list and integer n.
Output: Head of the updated linked list.
Input: [1,2,3,4,5], 2
Output: [1,2,3,5]
Explanation: 2nd from end is node(4). Remove it. Result: 1→2→3→5.Input: [1,2,3,4,5], 5
Output: [2,3,4,5]
Explanation: 5th from end = head(1). Remove head. Return node(2).Input: [1], 1
Output: []
Explanation: Only node removed. Return NULL.1<=nodes<=300<=Node.val<=1001<=n<=nodes