You are viewing a single comment's thread. Return to all comments →
int n=a.length; int brr[]=new int[queries.length]; while(k!=0) { int end=a[n-1]; for(int i=n-1;i>0;i--) { a[i]=a[i-1]; } a[0]=end; k--; } for(int i=0;i }
return brr;
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
int n=a.length; int brr[]=new int[queries.length]; while(k!=0) { int end=a[n-1]; for(int i=n-1;i>0;i--) { a[i]=a[i-1]; } a[0]=end; k--; } for(int i=0;i }