##C (104)
C (104)
void reverse(int* a, int* b)
{
while (--b > a) {
*b ^= *a;
*a ^= *b;
*b ^= *a;
++a;
}
}
void rotate(int *arr, int s_arr, int by)
{
reverse(arr, arr+s_arr);
reverse(arr, arr+by);
reverse(arr+by, arr+s_arr);
}
Minified:
v(int*a,int*b){while(--b>a){*b^=*a;*a^=*b;*b^=*a++;}}r(int*a,int s,int y){v(a,a+s);v(a,a+y);v(a+y,a+s);}