Skip to content

Commit f4efc81

Browse files
committed
Extra comment to show min and max cases
1 parent 7a2ac86 commit f4efc81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Cpp/capacityToShipPackages.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ class Solution {
8282
// between 4 and 9.
8383
// for maximum capacity is the sum of all packages.
8484

85+
// maximum capacity is the sum of all packages
8586
auto r = std::accumulate(ws.begin(), ws.end(), 0);
86-
auto l = std::max(r/totalTrips, *max_element(ws.begin(), ws.end()));
87+
88+
// minumum capacity is the largest package
89+
auto l = std::max(r/totalTrips, *max_element(ws.begin(), ws.end()));
8790
while(l<r)
8891
{
8992
auto m = (l+r)/2;

0 commit comments

Comments
 (0)