Skip to content

Commit d2266ca

Browse files
committed
Fixed sonar
1 parent 30e868c commit d2266ca

File tree

1 file changed

+4
-1
lines changed
  • src/main/java/g3201_3300/s3298_count_substrings_that_can_be_rearranged_to_contain_a_string_ii

1 file changed

+4
-1
lines changed

src/main/java/g3201_3300/s3298_count_substrings_that_can_be_rearranged_to_contain_a_string_ii/Solution.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public long validSubstringCount(String word1, String word2) {
1313
}
1414
long ans = 0;
1515
int needed = temp.length;
16-
for (int beg = 0, end = 0; end < n; end++) {
16+
int beg = 0;
17+
int end = 0;
18+
while (end < n) {
1719
if (f[ar[end] - 97]-- > 0) {
1820
needed--;
1921
}
@@ -25,6 +27,7 @@ public long validSubstringCount(String word1, String word2) {
2527
needed++;
2628
}
2729
}
30+
end++;
2831
}
2932
return ans;
3033
}

0 commit comments

Comments
 (0)