leetcode rotatenumber
public void rotate(int[] nums, int k) {
int n = nums.length;
int [] tmp = new int [k];
int j=0;
int i =0;
k=k%n;
for(i = n-k; i < n;i++)
{
tmp[j++] = nums[i];
}
j= n;
for(i = (n-k-1)>0?n-k-1:0 ; i >=0;i--)
{
nums[--j] = nums[i];
}
for( i = 0; i < k;i++)
{
nums[i] = tmp[i];
}
}