Same shape as Koko Eating Bananas — binary search the answer, not the array. Here the answer is a ship capacity. The feasibility check is a greedy simulation: load packages onto today's shipment in order; the moment one more would overflow the capacity, start a new day instead. Fewer days needed at a bigger capacity is monotonic, so the search is valid.