mirror of
https://github.com/SunnyQjm/algorithm-review.git
synced 2026-10-05 01:15:46 +08:00
Update 1_longest-palindromic-substring.py
This commit is contained in:
1 parent
6f4c145338
commit
ba3c315fde
1 file changed
+1
-1
@@ -42,7 +42,7 @@ class Solution:
|
||||
for i in range(2, len(s)):
|
||||
for j in range(0, len(s) - i):
|
||||
if dp[j + 1][j + i - 1] and s[j] == s[j + i]:
|
||||
find, resultStart, resultEnd, dp[j][j + i] = True, j, j + i + 1, True
|
||||
resultStart, resultEnd, dp[j][j + i] = j, j + i + 1, True
|
||||
return s[resultStart: resultEnd]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user