Skip to content

Commit 4990812

Browse files
authored
Update find-longest-self-contained-substring.py
1 parent a637590 commit 4990812

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/find-longest-self-contained-substring.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def maxSubstringLength(self, s):
127127
def check(l, r):
128128
return all(l <= left[ord(s[i])-ord('a')] and right[ord(s[i])-ord('a')] <= r for i in xrange(l, r+1))
129129

130-
left = [-1]*26
131-
right = [-1]*26
130+
left, right = [-1]*26, [-1]*26
132131
for i, x in enumerate(s):
133132
x = ord(x)-ord('a')
134133
if left[x] == -1:

0 commit comments

Comments
 (0)