Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Does the dynamic programming sound like the right algorithm after sorting?
Let's say box1 can be placed on top of box2. No matter what orientation box2 is in, we can rotate box1 so that it can be placed on top. Why don't we orient everything such that height is the biggest?