Lego Blocks

  • + 1 comment

    I don't know who needs to hears this, but as a 8 YoE software engineer, this took me an entire weekend to solve ^^'.

    A little spoiler-free tip I wish I had:

    • you will need to use the modulo whenever you can, because the amount of combination explodes pretty quickly. modulo is distributive over +, * and - operations, aka applying it to all those operators, is equivalent to only doing it once at the end.
    • even with modulo, in Typescript/Javascript you will need to watch out for some exploding results that exceed the maximum javascript integer (2^53-1)