Skip to main content

Practice ยท 3 of 4

Rotate left

CHALLENGE
Difficulty: beginner+25 XP

Implement static int[] RotateLeft(int[] values, int k) โ€” a NEW array with elements shifted left k positions, wrapping around. RotateLeft({1,2,3,4,5}, 2) is {3,4,5,1,2}. k larger than the length must still work; null input throws ArgumentException.

Back to lesson: Practice: Array workout