Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8d66658

Browse files
fix: wrong code in lc problem: No.2213
No.2213.Longest Substring of One Repeating Character
1 parent 4228f65 commit 8d66658

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎solution/2200-2299/2213.Longest Substring of One Repeating Character/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ func (t *segmentTree) pushup(x, l, m, r int) {
433433
if t.lmx[lch] == m-l+1 {
434434
t.lmx[x] += t.lmx[rch]
435435
}
436-
if t.rmx[rch] == r-(m+1)-1 {
436+
if t.rmx[rch] == r-m {
437437
t.rmx[x] += t.rmx[lch]
438438
}
439439
t.mx[x] = max(t.mx[x], t.rmx[lch]+t.lmx[rch])

‎solution/2200-2299/2213.Longest Substring of One Repeating Character/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ func (t *segmentTree) pushup(x, l, m, r int) {
410410
if t.lmx[lch] == m-l+1 {
411411
t.lmx[x] += t.lmx[rch]
412412
}
413-
if t.rmx[rch] == r-(m+1)-1 {
413+
if t.rmx[rch] == r-m {
414414
t.rmx[x] += t.rmx[lch]
415415
}
416416
t.mx[x] = max(t.mx[x], t.rmx[lch]+t.lmx[rch])

‎solution/2200-2299/2213.Longest Substring of One Repeating Character/Solution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (t *segmentTree) pushup(x, l, m, r int) {
4040
if t.lmx[lch] == m-l+1 {
4141
t.lmx[x] += t.lmx[rch]
4242
}
43-
if t.rmx[rch] == r-(m+1)-1 {
43+
if t.rmx[rch] == r-m {
4444
t.rmx[x] += t.rmx[lch]
4545
}
4646
t.mx[x] = max(t.mx[x], t.rmx[lch]+t.lmx[rch])

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /