Rotate an Array Left by One
Shift every element one place left and wrap the first to the end.
Input format
The first line contains N. The second line contains N space-separated integers.
Output format
Print the resulting array as space-separated integers on one line. Move every element one position to the left; the first element wraps to the end.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
5
3 1 4 1 5Expected output
1 4 1 5 3Example 2
Input
4
10 20 30 40Expected output
20 30 40 10