@@ -0,0 +1,937 @@
+package com.javalearning;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Comparator;%0A%0A/**%0A * Created by renqun.yuan on 2015/12/7.%0A */%0Apublic class MergeMaxNum %7B%0A%0A    /**%0A     * Write a function that given a list of non negative integers,%0A     * arranges them such that they form the largest possible number.%0A     * For example, given %5B50, 2, 1, 9%5D, the largest formed number is 95021.%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        Integer%5B%5D integers = %7B3, 2, 5%7D;%0A        Arrays.sort(integers, new Comparator%3CInteger%3E() %7B%0A            @Override%0A            public int compare(Integer o1, Integer o2) %7B%0A                String s1 = o1.toString();%0A                String s2 = o2.toString();%0A                return (s1 + s2).compareTo(s2 + s1) * -1;%0A            %7D%0A        %7D);%0A        String result = %22%22;%0A        for (Integer integer : integers) %7B%0A            result += integer;%0A        %7D%0A        System.out.println(result);%0A    %7D%0A%7D%0A

get max num