We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 704ddbd commit be635beCopy full SHA for be635be
src/main/kotlin/g3401_3500/s3456_find_special_substring_of_length_k/Solution.kt
@@ -21,10 +21,9 @@ class Solution {
21
if (flag) {
22
continue
23
}
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]) {
+ if (start - 1 >= 0 && s[start] == s[start - 1] ||
+ end < s.length && s[end] == s[end - 1]
+ ) {
28
start++
29
end++
30
} else {
0 commit comments