Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions docs/dataStructures-algorithms/几道常见的子符串算法题.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,21 @@ public class Main {

}

private static boolean checkStrs(String[] strs) {
if (strs != null) {
// 遍历strs检查元素值
for (int i = 0; i < strs.length; i++) {
if (strs[i] == null || strs[i].length() == 0) {
return false;
}
}
}
return true;
}
private static boolean chechStrs(String[] strs) {
boolean flag = false;
if (strs != null) {
// 遍历strs检查元素值
for (int i = 0; i < strs.length; i++) {
if (strs[i] != null && strs[i].length() != 0) {
flag = true;
} else {
flag = false;
break;
}
}
}
return flag;
}

// 测试
public static void main(String[] args) {
Expand Down