import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
public class Solution {
public String PrintMinNumber(int [] numbers) {
if(numbers==null || numbers.length==0) return "";
int n = numbers.length;
String [] nums = new String[n];
for(int i=0;i<n;i++){
nums[i] = numbers[i]+"";
}
Arrays.sort(nums,new Comparator<String>(){
public int compare(String o1,String o2){
return (o1+o2).compareTo(o2+o1);
}
});
String res = "";
for(String i : nums){
res+=i;
}
return res;
}
重写排序Array.sort()方法,由于底层为合并排序算法,复杂度为nlog(n)