#K90457. Left Array Rotation

    ID: 37756 Type: Default 1000ms 256MiB

Left Array Rotation

Left Array Rotation

You are given an array of ( n ) integers. Your task is to perform a left rotation on the array; that is, shift all elements of the array by one position to the left and move the first element to the last position. For example, if the array is ( [1, 2, 3, 4, 5] ), after one left rotation it becomes ( [2, 3, 4, 5, 1] ).

inputFormat

Input is read from standard input. The first line contains an integer ( n ) (where ( n \geq 0 )), representing the number of elements in the array. If ( n > 0 ), the second line contains ( n ) space-separated integers.

outputFormat

Output the left rotated array as a single line of space-separated integers to standard output. If the input array is empty (i.e. when ( n = 0 )), output nothing.## sample

5
1 2 3 4 5
2 3 4 5 1