@@ -0,0 +1,1883 @@
+import java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.io.IOException;%0A%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0A%0Apublic class LeftRotation %7B%0A%0A  private static final String SPACE = %22 %22;%0A%0A  private static int readRotations(BufferedReader reader) throws IOException %7B%0A    String line = reader.readLine();%0A    String%5B%5D split = line.split(SPACE);%0A    return Integer.parseInt(split%5B1%5D);%0A  %7D%0A%0A  private static List%3CInteger%3E readList(BufferedReader reader) throws IOException %7B%0A    String line = reader.readLine();%0A    String%5B%5D split = line.split(SPACE);%0A    List%3CInteger%3E numbers = new ArrayList%3C%3E();%0A    for (String element : split) %7B%0A      numbers.add(Integer.parseInt(element));%0A    %7D%0A    return numbers;%0A  %7D%0A%0A  private static List%3CInteger%3E leftRotate(int leftRotations, List%3CInteger%3E numbers) %7B%0A    int size = numbers.size();%0A    if (leftRotations == size) %7B%0A      return numbers;%0A    %7D%0A    List%3CInteger%3E head = numbers.subList(0, leftRotations);%0A    List%3CInteger%3E tail = numbers.subList(leftRotations, size);%0A    tail.addAll(head); // this method mutates the 'tail' list.%0A    if (tail.size() != size) %7B%0A      throw new IllegalStateException(%0A          %22The output list size should be the same as the input list size.%22%0A      );%0A    %7D%0A    return tail;%0A  %7D%0A%0A  private static void printList(List%3CInteger%3E list) %7B%0A    StringBuilder builder = new StringBuilder();%0A    for (Integer number : list) %7B%0A      builder.append(number).append(SPACE);%0A    %7D%0A    System.out.println(builder.toString().trim());%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) %7B%0A      int leftRotations = readRotations(reader);%0A      List%3CInteger%3E list = readList(reader);%0A      List%3CInteger%3E rotatedList = leftRotate(leftRotations, list);%0A      printList(rotatedList);%0A    %7D%0A  %7D%0A%7D%0A

Add solution for left rotation problem in Java.