You are given a list boxTypes, where each element boxTypes[i] is a pair [numberOfBoxes_i, numberOfUnitsPerBox_i] describing a box type. You are also given an integer truckSize, representing the maximum number of boxes the truck can carry in total.
Return the maximum total number of units that can be loaded onto the truck by choosing at most truckSize boxes across all types.
Note: You may take any number of boxes from a type, up to
numberOfBoxes_i.
Constraints:
boxTypes.length
numberOfBoxes_i, numberOfUnitsPerBox_i
truckSize
You are given a list boxTypes, where each element boxTypes[i] is a pair [numberOfBoxes_i, numberOfUnitsPerBox_i] describing a box type. You are also given an integer truckSize, representing the maximum number of boxes the truck can carry in total.
Return the maximum total number of units that can be loaded onto the truck by choosing at most truckSize boxes across all types.
Note: You may take any number of boxes from a type, up to
numberOfBoxes_i.
Constraints:
boxTypes.length
numberOfBoxes_i, numberOfUnitsPerBox_i
truckSize