Practice · 2 of 3
The Broken Stacking
CHALLENGE
Difficulty: advanced+25 XP
**Scenario.** Boxes have (weight w, limit L): stack boxes, each box's total load above it must not exceed its L. A greedy sorts by L descending and stacks heaviest-first inside ties. What breaks it? **Which approach is the best fit? The program only needs to print the letter.** **A)** Nothing — sorting by limit descending is provably optimal **B)** A tall stack of small-limit boxes can support more total weight than a heavy-bottom greedy wastes; treating 'heaviest first' inside a limit-class can strand a load-bearing box on top **C)** The order of equal-weight boxes **D)** Floating-point rounding of limits
Press Submit to check your solution.
Back to lesson: Practice: Greedy Proof Drills