Skip to content

Commit e2b4ffb

Browse files
authoredAug 27, 2020
Update stone-game-v.cpp
1 parent 1b775bd commit e2b4ffb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎C++/stone-game-v.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Solution2 {
5757
for (int l = 1; l <= n; ++l) {
5858
for (int i = 0; i <= n - l; ++i) {
5959
const int j = i + l - 1;
60-
int p = (l == 1) ? i + 1 : mid[i][j - 1];
60+
int p = (l == 1) ? i : mid[i][j - 1];
6161
while (prefix[p] - prefix[i] < prefix[j + 1] - prefix[p]) {
6262
++p; // Time: O(n^2) in total
6363
}

0 commit comments

Comments
 (0)
Please sign in to comment.