We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b775bd commit e2b4ffbCopy full SHA for e2b4ffb
C++/stone-game-v.cpp
@@ -57,7 +57,7 @@ class Solution2 {
57
for (int l = 1; l <= n; ++l) {
58
for (int i = 0; i <= n - l; ++i) {
59
const int j = i + l - 1;
60
- int p = (l == 1) ? i + 1 : mid[i][j - 1];
+ int p = (l == 1) ? i : mid[i][j - 1];
61
while (prefix[p] - prefix[i] < prefix[j + 1] - prefix[p]) {
62
++p; // Time: O(n^2) in total
63
}
0 commit comments