You are viewing a single comment's thread. Return to all comments →
Java 8
public static List<Integer> rotateLeft(int d, List<Integer> arr) { List<Integer> firstDElements = arr.subList(0, d); arr = arr.subList(d, arr.size()); arr.addAll(firstDElements); return arr; }
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
Java 8