private void reverse(int[] a, int lo, int hi) {
        while (lo < hi) {
            int temp = a[lo];
            a[lo] = a[hi];
            a[hi] = temp;
            lo++;
            hi--;
        }
    }
The idea is simple. First we will reverse all array elements. Then do another reversion of elements
up to given kth-1 index and the of part of the array. Voila! rotated :)
Time complexity is O(N) + O(N) = O(N);
src/problems/easy/RotateArray.java