You are viewing a single comment's thread. Return to all comments →
Java 8:
class Result implements Comparator<String>{ public int compare(String str1, String str2){ return (str1.length()==str2.length()) ? str1.compareTo(str2) : str1.length()-str2.length(); } public static List<String> bigSorting(List<String> unsorted) { Collections.sort(unsorted, new Result()); return unsorted; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
Java 8: