Package Delivery With Halving Truck Capacity

Asked at Amazon · Coding Questions · Difficulty: Medium

Each delivery truck has a weight capacity that halves (floor division by 2) after every delivery. A truck can carry a package only if its current capacity is `>=` the package weight. Given `truck_capacities` and `package_weights`, determine whether **all** packages can be delivered. Return `1` if possible, else `0`.

Loading the problem…