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

Commit4abf692

Browse files
authored
Update palindrome-partitioning-iv.cpp
1 parent2c6ee57 commit4abf692

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎C++/palindrome-partitioning-iv.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Solution {
1616
}
1717
for (constauto& i : prefix) {
1818
for (constauto& j : suffix) {
19+
int left = i +1 + P[i], right = j -1 - P[j];
1920
if (left > right) {
2021
continue;
2122
}
22-
int left = i +1 + P[i], right = j -1 - P[j];
2323
int mid = left + (right - left) /2;
2424
if (P[mid] >= mid - left) {
2525
returntrue;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp