Skip to content

Commit fc78fad

Browse files
authored
Update constrained-subset-sum.cpp
1 parent 3240128 commit fc78fad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/constrained-subset-sum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Solution {
1111
dq.pop_front();
1212
}
1313
const auto& curr = nums[i] + (!dq.empty() ? dq.front().second : 0);
14-
while (!dq.empty() && dq.back().second < curr) {
14+
while (!dq.empty() && dq.back().second <= curr) {
1515
dq.pop_back();
1616
}
1717
if (curr > 0) {

0 commit comments

Comments
 (0)