Lego Blocks

  • + 0 comments

    This is a pretty intense combinatorial problem. For the record just figuring out all of the ways to stack n number of 1x2 lego bricks contiguously is itself a deep theoretical math question for mathemeticians, and only has a theorem that was proven in 1988.

    Even attempting to brute force the solution is itself a challenge to write, let alone something reasonably efficient. I think if any company expected you to do this problem I would ask if any of their engineers could solve it provided you make a small tweak to the parameters.