Rotate Right by K — Solution & Editorial
Reduce K modulo N, then output the two slices swapped (or reverse-reverse-reverse for O(1) memory).
Complexity: O(N)
Reduce K modulo N, then output the two slices swapped (or reverse-reverse-reverse for O(1) memory).
Complexity: O(N)