Array rotation. Given an array of n elements, give a linear-time algorithm to rotate the string k positions. That is, if the array contains a0, a1 ..., an−1, the rotated array is ak, ak+1..., an− 1, a0, ..., ak−1. Use at most a constant amount of extra memory. Hint: Reverse three subarrays.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.