Practice

Rotate Array Left

MEDIUMArrays6 marks

Read six integers into an array. Move the first value to the end and shift every other value one position left, then output the rotated array.

Input: Six integers. Output: Six rotated values, one per line.

Example:

Input:  10 20 30 40 50 60
Output: 20
        30
        40
        50
        60
        10
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Ascending tens
Inputs: 10, 20, 30, 40, 50, 60
Expected: 20 30 40 50 60 10
Test 2: Ascending values
Inputs: 1, 2, 3, 4, 5, 6
Expected: 2 3 4 5 6 1