Skip to main content

Practice · 2 of 6

Rotate right

CHALLENGE
Difficulty: intermediate+25 XP

Implement int[] rotateRight(int[] arr): a NEW array shifted right by one, last element wrapping to the front. Write the two failure cases (length 0 and 1) into your loop before running anything.

Back to lesson: Practice: Array lab