public void shortestString(String[] strs) {
int l = 0;
//取出最短字符串
String[] ss = new String[0];
List<String> sl = new ArrayList<>();
for (int i = 0; i < strs.length - 1; i++) {
int m = strs[i].length();
int n = strs[i + 1].length();
if (m == n && l >= m) {
l = m;
if (!sl.contains(strs[i])) {
sl.add(strs[i]);
}
sl.add(strs[i + 1]);
} else if (m < n && l <= m) {
l = m;
if (!sl.contains(strs[i])) {
sl.add(strs[i]);
}
} else {
if (l == n) {
sl.add(strs[i + 1]);
} else if (l > n) {
l = n;
sl.clear();
sl.add(strs[i + 1]);
}
}
}
System.out.println(Arrays.toString(sl.toArray(ss)));
}