Algorithm · Meta · Hard
First task Let packages be an array of positive integers, where each integer is the weight of one package. The packages must be delivered in the given order, and no package can be split across shipments. A cargo ship can carry at most capacity units of weight per day. On each day, you may load one or more consecutive packages from the front of the remaining queue; their total weight cannot exceed capacity. Find the smallest integer capacity that allows all packages to be…
Checking your access…