Skip to content

Commit 0bcda05

Browse files
fix build
1 parent 8a0992a commit 0bcda05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ public boolean checkPartitioning(String s) {
1616
for (int i = n - 1; i >= 0; i--) {
1717
for (int j = 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 (int i = 1; i < n - 1; i++) {
26-
for (int j = 1; j < n - 1; j++) {
26+
for (int j = i; j < n - 1; j++) {
2727
if (dp[0][i - 1] && dp[i][j] && dp[j + 1][n - 1]) {
2828
return true;
2929
}
3030
}
3131
}
32-
return true;
32+
return false;
3333
}
3434

3535
}

0 commit comments

Comments
 (0)