Given an array of integers `capacities` representing the storage capacities of a set of containers and an integer `totalSupplies` representing the total amount of supplies to be stored, find the maximum number of supplies that can be stored without exceeding the capacities of the containers.
Explanation: The maximum number of supplies that can be stored is 50 by filling the first two containers: 10 + 20 + 20 = 50.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak