Box Stacking
Application of Longest Increasing Subsequence
-
Algorithms and Data Structures: TheAlgorist.com
-
System Design: www.System.Design
-
Low Level Design: LowLevelDesign.io
-
Frontend Engineering: FrontendEngineering.io
জয় শ্রী রাম
🕉
Problem Statement:
You are given a set of n types of rectangular 3-D boxes, where the ith box has height h(i), width w(i) and length l(i) (all real numbers). You want to create a stack of boxes which is as tall as possible, but you can only stack a box on top of another box if the dimensions of the 2-D base of the lower box are each strictly larger than those of the 2-D base of the higher box. Of course, you can rotate a box so that any side functions as its base. It is also allowable to use multiple instances of the same type of box.
Solution:
Login to Access Content
Other related chapters:
- Core Concept
- Russian Doll Envelopes
- Largest Divisible Subset
- Longest String Chain
- Best Team with No Conflict
- Longest Bitonic Subsequence