k = k % nums.length;

int rotated[] = new int[nums.length];

for (int i = 0; i < nums.length; i++) {

rotated[i] = nums[i];

}

for (int j = 0; j < k; j++) {

nums[j] = nums[nums.length - (k - j)];

}

for (int l = k; l < nums.length ; l++) {

nums[l] = rotated[l - k];

}

for (int m =0; m < nums.length; m++) {

System.out.print(nums[m]);

}