Array Rotation
For right rotation by k positions, first reduce k using k modulo n. An efficient in-place approach uses three reversals: reverse the entire array, reverse the first k elements, then reverse the remaining elements.
Time complexity: O(n).
Extra space: O(1) for the reversal approach.
An extra-array approach is simpler but requires O(n) additional space.
For very large k, k % n avoids unnecessary rotations.
The direction of rotation must be defined clearly.