Moving the last k elements to the beginning of array
The time complexity is O(n)