public class Solution {

public int[] rotate(int[] nums, int k) {

```
if(k>=nums.length)
k= k%nums.length;
int[] son = new int[nums.length];
if(nums.length==1||k==0)
return nums;
for (int j=k,i=0; j<nums.length;j++,i++){
son[j]=nums[i];
}
for(int m = nums.length -k,j=0;m<nums.length;m++,j++){
son[j]=nums[m];
}
return son;
}
```

}