按顺序输出最小的数

    科技2025-01-13  10

    String[] str = new String[nums.length]; for(int i=0;i<nums.length;i++){ str[i] = String.valueOf(nums[i]); } Arrays.sort(str,(s1,s2)->(s1+s2).compareTo(s2+s1)); StringBuilder res = new StringBuilder(); for(String s:str){ res.append(s); } return res.toString();
    Processed: 0.014, SQL: 8