Algorithm · Amazon · Hard
Amazon operates a fleet of drones with distinct carrying capacities from 1 through 10^9. Drone j can carry a shipment weighing at most j. There are n shipments to deliver, and parcels[i] gives the weight of the i-th shipment. For this task, exactly two drones are available, and they must take turns delivering shipments. If one drone delivers shipment i, the other drone must deliver shipment i + 1, continuing in alternating order. A shipment whose weight is greater than the…
Checking your access…