You are viewing a single comment's thread. Return to all comments →
The starting value of the i is 0. Looks like correct calculation to me. What result are you expecting?
ha, yeah i wasn't understanding right! I made it this way, that's why I was confused. rotated[(n+i-d)%n] = a[i]. Which is analogous to yours, but calculating the index in destination. Yours is more clear I think. Thanks!