@@ -0,0 +1,703 @@
+package javaStringCompare;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%0A%09public static String%5B%5D readAndSplitString(Scanner scanner) %7B%0A%09%09String line = scanner.next();%0A%09%09int windowLength = scanner.nextInt();%0A%09%09String%5B%5D lines = new String%5Bline.length() - windowLength + 1%5D;%0A%09%09for(int i = 0; i %3C line.length() - windowLength + 1; ++i) %7B%0A%09%09%09lines%5Bi%5D = line.substring(i, windowLength + i);%0A%09%09%7D%0A%09%09return lines;%0A%09%7D%0A%09%0A%09public static void main(String ...args) %7B%0A%09%09Scanner scanner = new Scanner(System.in);%0A%09%09String%5B%5D lines = readAndSplitString(scanner);%0A%09%09Arrays.sort(lines);%0A%09%09System.out.println(lines%5B0%5D);%0A%09%09System.out.println(lines%5Blines.length - 1%5D);%0A%09%09scanner.close();%0A%09%7D%0A%7D%0A

Add solution for problem Java String Compare