• + 0 comments

    Java soluation:

    public static List<String> bigSorting(List<String> unsorted) {
     
        Collections.sort(unsorted , new Comparator<String>() {
            @Override
            public int compare(String s1, String s2) {
                int length = s1.length() - s2.length();
                if(length != 0)
                   return length;
                    
                BigInteger n1 = new BigInteger(s1);
                BigInteger n2 = new BigInteger(s2);
                return n1.compareTo(n2);
                }
        });
        return unsorted; 
       }