You are given an array apple of size n and an array capacity of size m.
There are n packs of apples, where the apple[i] apples. There are also m boxes available, where the capacity[i] apples.
Return the minimum number of boxes needed to redistribute all the apples. Apples from the same pack can be split and placed into different boxes.
Constraints:
apple.length
capacity.length
apple[i], capacity[i]
The input is generated such that it is always possible to redistribute the packs of apples into the boxes.
You are given an array apple of size n and an array capacity of size m.
There are n packs of apples, where the apple[i] apples. There are also m boxes available, where the capacity[i] apples.
Return the minimum number of boxes needed to redistribute all the apples. Apples from the same pack can be split and placed into different boxes.
Constraints:
apple.length
capacity.length
apple[i], capacity[i]
The input is generated such that it is always possible to redistribute the packs of apples into the boxes.