You are given a linked list and a number n. Remove the n-th node counting from the end of the list (the last node is the 1st from the end). Return the list after the removal.
How the judge passes the data
Examples
Example 1:
Input: head = [10,20,30,40], n = 1
Output: [10,20,30]
Explanation: The 1st node from the end is 40. Remove it.
Example 2:
Input: head = [3,6,9,12,15], n = 3
Output: [3,6,12,15]
Explanation: Counting from the end: 15, 12, 9. The 3rd one is 9. Remove it.
Example 3:
Input: head = [7], n = 1
Output: []
Explanation: Remove the only node. The list becomes empty.