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

Commitf6feb4a

Browse files
HARD/src/hard/PalindromePartitioningII.java
1 parentf505d6f commitf6feb4a

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
publicintminCut(Strings) {
1012
intn =s.length();
1113
char[]c =s.toCharArray();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp