public static String minNumber(int[] nums) {
//to IntStream
return Arrays.stream(nums)
//to Stream<Integer>
.boxed()
//Stream<String>
.map(String::valueOf)
//排序
.sorted((o1, o2) -> (o1 + o2).compareTo(o2 + o1))
//to String
.collect(Collectors.joining(""));
}
评论