题解 | #拼接所有的字符串产生字典序最小的字符串#
拼接所有的字符串产生字典序最小的字符串
http://www.nowcoder.com/practice/f1f6a1a1b6f6409b944f869dc8fd3381
import java.util.*; import java.util.stream.Collectors; public class Solution { /** * * @param strs string字符串一维数组 the strings * @return string字符串 */ public String minString (String[] strs) { // write code here return Arrays.stream(strs).sorted((o1, o2) -> (o1 + o2).compareTo(o2 + o1)).collect(Collectors.joining()); } }