Skip to content

Commit f6feb4a

Browse files
HARD/src/hard/PalindromePartitioningII.java
1 parent f505d6f commit f6feb4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

HARD/src/hard/PalindromePartitioningII.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class PalindromePartitioningII {
66
//cut[i] stands for the minimum number of cut needed to cut [0, i] into palindromes
77
//we initiazlie cut[i] with its max possible value which is i, this is because a single char is naturally a palindrome, so, we'll cut this string into all single-char substrings, which is the max cuts needed
88

9+
//dp[j][i] == true stands for s.substring(j,i) is a palindrome
10+
911
public int minCut(String s) {
1012
int n = s.length();
1113
char[] c = s.toCharArray();

0 commit comments

Comments
 (0)