class Solution {

```
public:
void rotate(int nums[], int n, int k) {
int count = 0;
int current = 0;
int vcurrent = nums[current];
int ocurrent = current;
while(count < n){
std::swap(vcurrent, nums[(current + k) % n]);
current = (current + k) % n;
count++;
if(current == ocurrent){
current = (ocurrent + 1) % n;
vcurrent = nums[current];
ocurrent = current;
}
}
}
```

};

every time put one element to its proper place, and use vcurrent to keep the old one

do it for n times.

but if the current return to its original value before n exchanges, let's start from a new index.

I get this solution but even I couldn't understand it intuitively.

Any comments are welcome.