You are viewing a single comment's thread. Return to all comments →
My Solution :
public static int[] arrayLeftRotation(int[] a, int n, int k) { int[] b = new int[n]; for(int i=0;i<n-k;i++){ b[i] = a[k+i]; } int l = 0; for(int i=n-k;i<n;i++){ b[i] = a[l++]; } return b; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
My Solution :