Skip to content

Commit a8075fd

Browse files
authored
Update longest-happy-prefix.py
1 parent a3f6a30 commit a8075fd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/longest-happy-prefix.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def longestPrefix(self, s):
99
:rtype: str
1010
"""
1111
def getPrefix(pattern):
12-
prefix = [-1] * len(pattern)
12+
prefix = [-1]*len(pattern)
1313
j = -1
1414
for i in xrange(1, len(pattern)):
1515
while j != -1 and pattern[j+1] != pattern[i]:
@@ -37,7 +37,6 @@ def check(l, s):
3737
for i in xrange(l):
3838
if s[i] != s[len(s)-l+i]:
3939
return False
40-
4140
return True
4241

4342
result, prefix, suffix, power = 0, 0, 0, 1

0 commit comments

Comments
 (0)