Skip to content

Commit 370c279

Browse files
cclaussCaedenPH
andauthored
Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <[email protected]>
1 parent 5d5be65 commit 370c279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dynamic_programming/palindrome_partitioning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ def find_minimum_partitions(string: str) -> int:
2222
"""
2323
n = len(string)
2424
cut = [0] * n
25-
ispalindrome = [[False for i in range(n)] for j in range(n)]
25+
is_palindromic = [[False for i in range(n)] for j in range(n)]
2626
for i in range(n):
2727
mincut = i
2828
for j in range(i + 1):
2929
if string[i] == string[j] and (i - j < 2 or ispalindrome[j + 1][i - 1]):
30-
ispalindrome[j][i] = True
30+
is_palindromic[j][i] = True
3131
mincut = min(mincut, 0 if j == 0 else (cut[j - 1] + 1))
3232
cut[i] = mincut
3333
return cut[n - 1]

0 commit comments

Comments
 (0)