142. Rotate the List
Build the list, read k, rotate the list to the RIGHT by k places, and
print the result.
Rotating 1 2 3 4 5 right by 2 gives 4 5 1 2 3, the last two nodes move to the front.
k may be larger than the list, and may be zero. Print Empty for an empty list.
Constraints - `0 ≤ n ≤ 100000` - `0 ≤ k ≤ 1000000000` - `-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, how far to rotate right. It may exceed the length, and may be zero.
Output
Print the resulting list from head to tail on ONE line, separated by single spaces, or Empty if no nodes remain.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.