Skip to content

Commit ee47476

Browse files
authored
Update substring-with-largest-variance.py
1 parent 68e8e51 commit ee47476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/substring-with-largest-variance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def modified_kadane(a, x, y):
2323
curr += 1 if c == x else -1
2424
if curr < 0 and remain[0] and remain[1]:
2525
curr = lookup[0] = lookup[1] = 0 # reset states if the remain has both x, y
26-
if lookup[0] and lookup[1]: # update result if x, y both exist
27-
result = max(result, curr)
26+
if lookup[0] and lookup[1]:
27+
result = max(result, curr) # update result if x, y both exist
2828
return result
2929

3030
alphabets = set(s)

0 commit comments

Comments
 (0)