```
public void Rotate(int[] nums, int k) {
if(nums == null || nums.Length < 2 || k == 0)
return;
int [] arr = new int[nums.Length];
int n = nums.Length;
for(int i = 0;i < nums.Length;i++){
arr[(i + k) % n] = nums[i];
}
arr.CopyTo(nums , 0);
}
```