Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1bb85ff

Browse files
committedNov 12, 2023
fix gradle build
1 parent 57ed447 commit 1bb85ff

File tree

1 file changed

+5
-4
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+5
-4
lines changed
 

‎src/main/java/com/fishercoder/solutions/_28.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ public int strStr(String haystack, String needle) {
2323
int n = needle.length();
2424
int h = haystack.length();
2525

26-
for(int i = 0; i <= h - n; i++) {
27-
for(int j = 0; j < n && haystack.charAt(i + j) == needle.charAt(j); j++) {
28-
if(j == n - 1) return i;
26+
for (int i = 0; i <= h - n; i++) {
27+
for (int j = 0; j < n && haystack.charAt(i + j) == needle.charAt(j); j++) {
28+
if (j == n - 1) {
29+
return i;
30+
}
2931
}
3032
}
31-
3233
return -1;
3334
}
3435
}

0 commit comments

Comments
 (0)
Please sign in to comment.