Filling Bookcase Shelves With Min Height
Minimize bookshelf height by placing books with total thickness <= shelfWidth on each level. Use dynamic programming to track min height after placing each book.
1105. Filling Bookcase Shelves Medium You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth. We want to place these books in order onto bookcase shelves that have a total width shelfWidth. We choose some of the books to place on this shelf such that the sum of their thickness is less than or equal to shelfWidth, then build another level of the shelf of the bookcase so that the total height of the bookcase has increased by the maximum height of the books we just put down. We repeat this pr...
