Skip to content

Commit c05ac72

Browse files
authored
Update palindrome-partitioning-iv.py
1 parent 00d2e57 commit c05ac72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/palindrome-partitioning-iv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def modified_manacher(s):
3434

3535
# Time: O(n^2)
3636
# Space: O(n)
37-
class Solution(object):
37+
class Solution2(object):
3838
def checkPartitioning(self, s):
3939
"""
4040
:type s: str
@@ -45,7 +45,7 @@ def checkPartitioning(self, s):
4545
for j in xrange(i, len(s)):
4646
if s[i] == s[j] and (j-i < 2 or dp[i+1][j-1]):
4747
dp[i][j] = True
48-
for i in xrange(1, len(s)):
48+
for i in xrange(1, len(s)-1):
4949
for j in xrange(i+1, len(s)):
5050
if dp[0][i-1] and dp[i][j-1] and dp[j][-1]:
5151
return True

0 commit comments

Comments
 (0)