You are viewing a single comment's thread. Return to all comments →
// Java public static List<Integer> rotLeft(List<Integer> a, int d) { List<Integer> rotated = new ArrayList<>(); int index =0 ; for(int i =d; i<a.size(); i++){ rotated.add(a.get(i)); } while(index<d){ rotated.add(a.get(index)); index++; } return rotated; } }
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 →