把数组排成最小的数
把数组排成最小的数
http://www.nowcoder.com/questionTerminal/8fecd3f8ba334add803bf2a06af1b993
import java.util.ArrayList; import java.util.Arrays; import java.util.stream.Collectors; public class Solution { public String PrintMinNumber(int [] numbers) { String res = Arrays.stream(numbers) .mapToObj(Integer::toString) .sorted((a, b) -> (a+b).compareTo(b+a)) .collect(Collectors.joining()); return res; } }