多的0 要想办法去除



public class Solution {
    /**
     * 最大数
     * @param nums int整型一维数组 
     * @return string字符串
     */
    public String solve (int[] nums) {
        // write code here
        int len = nums.length;
        String[] ss = new String[len];
        for(int i=0;i<len;i++){
            ss[i] = ""+nums[i];
        }
        Arrays.sort(ss,(a,b)->{
          String sa = a+b;
          String  sb = b+a;
            return sb.compareTo(sa);
        });
        StringBuilder sb = new StringBuilder();
        for(String s:ss){
            sb.append(s);
        }
        int n = sb.length();
        int k = 0;
        while(k<n-1&&sb.charAt(k)=='0') k++;
        
        return sb.substring(k);
    }
}