public class Solution {

```
public void rotate(int[] nums, int k) {
int length=nums.length;
int rk=k%length;
int [] copy=new int[length*2];
for(int i=0;i<2*length;i++){
copy[i]=nums[i%length];
}
for(int t=length-rk,i=0;t<2*length-rk;t++,i++)
{
nums[i]=copy[t];
}
}
```

}