Skip to content

Commit 43684e0

Browse files
authored
Update delivering-boxes-from-storage-to-ports.cpp
1 parent a91211e commit 43684e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/delivering-boxes-from-storage-to-ports.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution {
1313
curr += boxes[right][1];
1414
while (right - left + 1 > maxBoxes ||
1515
curr > maxWeight ||
16-
(left + 1 < right + 1 && dp[left + 1] == dp[left])) {
16+
(left + 1 < right + 1 && dp[left + 1] == dp[left])) { // greedily drop box to make cost as smaller as possible
1717
curr -= boxes[left][1];
1818
if (boxes[left + 1][0] != boxes[left][0]) {
1919
--cost;

0 commit comments

Comments
 (0)