Skip to content

Commit be635be

Browse files
committed
Fixed sonar
1 parent 704ddbd commit be635be

File tree

1 file changed

+3
-4
lines changed
  • src/main/kotlin/g3401_3500/s3456_find_special_substring_of_length_k

1 file changed

+3
-4
lines changed

src/main/kotlin/g3401_3500/s3456_find_special_substring_of_length_k/Solution.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ class Solution {
2121
if (flag) {
2222
continue
2323
}
24-
if (start - 1 >= 0 && s[start] == s[start - 1]) {
25-
start++
26-
end++
27-
} else if (end < s.length && s[end] == s[end - 1]) {
24+
if (start - 1 >= 0 && s[start] == s[start - 1] ||
25+
end < s.length && s[end] == s[end - 1]
26+
) {
2827
start++
2928
end++
3029
} else {

0 commit comments

Comments
 (0)