```
public class Solution {
public void rotate(int[] nums, int k) {
int [] newArray = new int[nums.length];
int pivot= nums.length - k ;
int i=0;
while(pivot < nums.length && i < nums.length){
newArray[i]=nums[pivot];
i++;
pivot++;
}
while(i<=nums.length){
newArray[i]=nums[i];
}
```

}

}