[CC150v5] 9.10 Stack up the Boxes - Shuatiblog.com
[CC150v5] 9.10 Stack Up the Boxes
Question
You have a stack of n boxes, with widths w., heights h, and depths d. The boxes can only be stacked on top of one another if each box is strictly larger than the box above it in width, height, and depth.
Implement a method to build the tallest stack possible, where the height of a stack is the sum of the heights of each box.
Solution
This is appearantly a DP question. I did it in the normal way, and the solution turns out to be very good:
Read full article from [CC150v5] 9.10 Stack up the Boxes - Shuatiblog.com
No comments:
Post a Comment