import java.util.*; import java.util.stream.Collectors; public class Solution { /** * 最大数 * @param nums int整型一维数组 * @return string字符串 */ public String solve (int[] nums) { // write code here String res = Arrays.stream(nums).mapToObj(String::valueOf).sorted(((o1, o2) -> (o2 + o1).compareTo(o1 + o2))).collect(Collectors.joining()); if(res.startsWith("0")){ return "0"; }else { return res; } } }