You are viewing a single comment's thread. Return to all comments →
static int[] circularArrayRotation(int[] a, int k, int[] queries) { int arr[] = new int[a.length]; for(int i=0 ; i<a.length ; i++) arr[(i+k)%a.length] = a[i]; for(int i=0 ; i<queries.length ; i++) queries[i] = arr[queries[i]]; return queries; }
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 →