Problem 189 · Medium

Rotate Array

Reverse the whole array, then reverse the first k and the remaining n-k elements.

Open the interactive visualisation