
Anyway, 118 is an easier problem.

Moderator: Board moderators
David, I was thinking about this part... Consider this boxes (with sorted dimensions):dawynn wrote:2) I sorted my boxes also, based on the first dimension (after the dimensions for each box had been sorted). The only problem with this, is that you need to also keep track of the order the boxes were originally read in. I kept track of the order as an extra dimension, one that would not be compared when determining nesting ability.
In this problem I've made a graph (edge A->B if A nests in B) and then used graph search in topological order (I think it's a bit DP solution).seg10 wrote:I have what I believe is a DP solution to the problem.
4 does not belong in the sequence because 17 is not less than 11 and others on that row are also not less than row 57) 01 02 03 04 05 06
1) 01 02 05 10 20 30
2) 03 07 09 11 15 23
5) 04 08 17 18 27 31
3) 04 14 24 34 40 50
4) 09 10 11 12 13 14
8) 09 18 21 37 47 80
6) 13 19 19 32 41 44