```
public class Solution {
public void Rotate(int[] nums, int k) {
if (k == 0) return;
int l = nums.Length;
int[] result = new int[l];
k = k % l;
for(int i = 0; i < l - k; i++){
result[k + i] = nums[i];
}
for(int j = 0; j < k; j++)
{
result[j] = nums[l - k + j];
}
for(int p = 0; p < l; p++){
nums[p] = result[p];
}
}
}
```