You are viewing a single comment's thread. Return to all comments →
Java
public static List<Integer> rotateLeft(int d, List<Integer> arr) { Queue<Integer> q = new ArrayDeque<>(arr); while(d > 0){ int data = q.poll(); q.offer(data); d--; } return new ArrayList<>(q); }
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