Question DSA-ARR-0050
MediumHow can you rotate an array of n elements left by k positions in O(n) time and O(1) space?
- A.
Reverse the first k, reverse the rest, then reverse the whole array
- B.
Sort the array
- C.
Sign up free to see the answer and a step-by-step explanation.