n boxes. Box i holds up to limits[i] items and already contains loaded[i]. You also have spare loose items that you can put into any boxes (you don't have to use them all).
Return the largest number of boxes that can end up completely full.limits=[5, 3, 7, 2], loaded=[5, 1, 3, 0], spare=4 → 3
The boxes are short 0, 2, 4 and 2 items. The first one is already full, and two more are topped up with 2 items each, giving 3 full boxes.
limits=[6, 6], loaded=[1, 2], spare=3 → 0
Each box needs more than 3 items, so none of them can be filled.
limits=[5, 3, 7, 2], loaded=[5, 1, 3, 0], spare=4
3
Run checks the first 3 tests in your browser. Submit checks all 92 tests on the server, hidden ones included.