My code is like this:

```
int gcd(int a, int b){
if(a<b){
gcd(b,a);
}
if(a%b){
gcd(b,a%b);
}
else{
return b;
}
}
void rotate(int nums[], int n, int k) {
int lcm;
int i,j;
int temp;
int gcd_nk;
if(k==0){
return;
}
if(k>n){
k = k%n;
}
gcd_nk = gcd(n,k);
lcm = gcd_nk * (n/gcd_nk) * (k/gcd_nk);
for (j=0; j<lcm/k; j++){
for(i=j; i<n/i-1; i+=k){
temp = nums[(i+k)%n];
nums[(i+k)%n] = nums[j];
nums[j] = temp;
}
}
}
```

and the test case is [1], 1. It seems give me the wrong input, however, when I change my function declare as

void rotate(int nums[] , int k) , I get the compiler error: too many arguments to function ‘rotate’.