You are given an integer array
capacity, wherecapacity[i]represents the capacity of thei^thbox, and an integeritemSizerepresenting the size of an item.The
i^thbox can store the item ifcapacity[i] >= itemSize.Return an integer denoting the index of the box with the minimum capacity that can store the item. If multiple such boxes exist, return the smallest index.
If no box can store the item, return -1.
1 | class Solution { |