```
public class Solution {
public void rotate(int[] nums, int k) {
int n = nums.length;
int[] newList = new int[n];
if (n > 1) {
k = k % n;
System.arraycopy(nums, n - k, newList, 0, k);
System.arraycopy(nums, 0, newList, k, n - k);
System.arraycopy(newList, 0, nums, 0, n);
}
}
}
```