Leetcode 1105. Filling Bookcase Shelves
Partition the ordered list of books into contiguous shelves so each shelf's total thickness ≤ shelfWidth and the shelf height equals the maximum book height on it; minimize the sum of shelf heights. The core challenge is deciding how far to extend each shelf (a prefix-partitioning problem) solvable with dynamic programming over book indices.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.