Skip to content

Commit 1bb93be

Browse files
authored
Update maximum-product-of-the-length-of-two-palindromic-substrings.cpp
1 parent 2ef2124 commit 1bb93be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/maximum-product-of-the-length-of-two-palindromic-substrings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ class Solution2 {
8989
for (int i = size(intervals) - 2; i >= 0; --i) {
9090
dp[i] = max(dp[i], dp[i + 1] - 2);
9191
}
92-
vector<int> result = {dp[0]};
93-
for (int i = 1; i < size(dp) - 1; ++i) {
92+
vector<int> result = {0};
93+
for (int i = 0; i < size(dp); ++i) {
9494
result.emplace_back(max(result.back(), dp[i]));
9595
}
9696
return result;

0 commit comments

Comments
 (0)