Skip to content

Commit 7261f14

Browse files
authored
Update partition-array-into-three-parts-with-equal-sum.cpp
1 parent 7bc1786 commit 7261f14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/partition-array-into-three-parts-with-equal-sum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Solution {
1111
int curr = 0, parts = 0;
1212
for (const auto& x : A) {
1313
curr += x;
14-
if (sum == total / 3) {
14+
if (curr == total / 3) {
1515
++parts, curr = 0;
1616
}
1717
}

0 commit comments

Comments
 (0)