You are viewing a single comment's thread. Return to all comments →
public static List<String> bigSorting(List<String> unsorted) { Map<Integer, List<String>> map = unsorted.stream().collect(Collectors.groupingBy(String::length)); List<String> result = new ArrayList<>(); map.keySet().stream().sorted().forEach(key -> { List<String> r = map.get(key); r.sort((s1, s2) -> s1.compareTo(s2)); result.addAll(r); }); return result; }
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 →