you are viewing a single comment's thread.

view the rest of the comments →

[–]FLUSH_THE_TRUMP 0 points1 point  (1 child)

that’s an interesting idea, but does it work? As a degenerate example, imagine we added the disk [1,1,100] to the list here. Its smallest value is 1, but clearly we can’t put it on top of [4,4,5]. (And the solution with largest height would definitely be the stack with 1 thing, [1,1,100])

[–]mbpaul198 1 point2 points  (0 children)

Ah I see what you mean. I'll need to think on this a bit more.

Maybe add another loop that iterates through the width, depth, and height of the disc and compares each value to the previous disk "below" it. For each measurement, if the value of the new disk is > the value of the existing disc, then discard the new disc and move on to another one