Based on http://www.geeksforgeeks.org/array-rotation/ (first method)

```
public class Solution {
public void rotate(int[] nums, int k) {
k = k % nums.length;
if (nums.length < 2) {
return;
}
k = nums.length - k;
int[] temp = new int[k];
for (int i = 0 ; i < k ; i++ ) {
temp[i] = nums[i];
}
for (int i = k; i < nums.length; i++) {
nums[i -k] = nums[i];
}
for (int i = 0; i < k; i++) {
nums[nums.length -k + i] = temp[i];
}
}
}
```