143. Remove the Nth Node From the End
Build the list, read k, and remove the kth node counting from the END,
where k = 1 is the last node.
Print the resulting list, Empty if nothing remains, or Invalid if k is larger than
the list.
Constraints - `0 ≤ n ≤ 100000` - `1 ≤ k ≤ 200000` - `-1000000 ≤ value ≤ 1000000`
Input
The first line contains an integer n, the number of nodes.
The second line contains n space-separated integers, the node values from head to tail.
The starter code builds the list for you; work on the nodes, not the array.
The third line contains an integer k.
Output
Print the resulting list from head to tail, separated by single spaces, Empty if nothing remains, or Invalid if k exceeds the length.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.