Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc05ac72

Browse files
authored
Update palindrome-partitioning-iv.py
1 parent00d2e57 commitc05ac72

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-
classSolution(object):
37+
classSolution2(object):
3838
defcheckPartitioning(self,s):
3939
"""
4040
:type s: str
@@ -45,7 +45,7 @@ def checkPartitioning(self, s):
4545
forjinxrange(i,len(s)):
4646
ifs[i]==s[j]and (j-i<2ordp[i+1][j-1]):
4747
dp[i][j]=True
48-
foriinxrange(1,len(s)):
48+
foriinxrange(1,len(s)-1):
4949
forjinxrange(i+1,len(s)):
5050
ifdp[0][i-1]anddp[i][j-1]anddp[j][-1]:
5151
returnTrue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp