Search
⌘K

Leetcode 189. Rotate Array

Rotate an integer array to the right by k steps (k may exceed the array length), effectively moving each element to index (i+k) mod n. Aim for an efficient solution—typically O(n) time—and if possible do it in-place with O(1) extra space.

Asked at:

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid October, 2025

Microsoft

Microsoft

Mid-level

Comments

Your account is free and you can post anonymously if you choose.