Leetcode 1889. Minimum Space Wasted From Packaging
Choose one supplier whose infinite-supply box sizes must each be at least as large as the package they hold, and minimize the total wasted space (sum of box size − package size) for all packages or return -1 if any package is too large. Core challenge: for each supplier decide feasibility and compute minimal waste efficiently by sorting packages and box sizes and using prefix sums + binary searches to group packages into the smallest adequate boxes.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.