You are viewing a single comment's thread. Return to all comments →
Very clean and fast (passes all test cases) using Java:
class MyComparator implements Comparator<String> { public int compare(String x, String y) { if (x.length() == y.length()) { return x.compareTo(y); } return x.length() - y.length(); } }
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 →
Very clean and fast (passes all test cases) using Java: