We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac3a10a commit 47776dbCopy full SHA for 47776db
docs/dataStructures-algorithms/几道常见的子符串算法题.md
@@ -135,17 +135,20 @@ public class Main {
135
136
}
137
138
- private static boolean checkStrs(String[] strs) {
139
- if (strs != null) {
140
- // 遍历strs检查元素值
141
- for (int i = 0; i < strs.length; i++) {
142
- if (strs[i] == null || strs[i].length() == 0) {
143
- return false;
144
- }
145
146
147
- return true;
148
+ 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;
+ }
149
150
+ return flag;
151
152
153
// 测试
154
public static void main(String[] args) {
0 commit comments