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

Commit0bcda05

Browse files
fix build
1 parent8a0992a commit0bcda05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/main/java/com/fishercoder/solutions/_1745.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ public boolean checkPartitioning(String s) {
1616
for (inti =n -1;i >=0;i--) {
1717
for (intj =i;j <n;j++) {
1818
if (s.charAt(i) ==s.charAt(j)) {
19-
dp[i][j] = (i +1 <j -1) ?dp[i +1][j -1] :true;
19+
dp[i][j] = (i +1 <=j -1) ?dp[i +1][j -1] :true;
2020
}else {
2121
dp[i][j] =false;
2222
}
2323
}
2424
}
2525
for (inti =1;i <n -1;i++) {
26-
for (intj =1;j <n -1;j++) {
26+
for (intj =i;j <n -1;j++) {
2727
if (dp[0][i -1] &&dp[i][j] &&dp[j +1][n -1]) {
2828
returntrue;
2929
}
3030
}
3131
}
32-
returntrue;
32+
returnfalse;
3333
}
3434

3535
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp