• + 1 comment

    Great stuff here, Lovealmgren. I plan to use a version of this algorithm myself.

    Why exactly three bases, no more and no less? Why not two, or four?

    If I had to guess, I'd suspect you found out through empirical testing -- add 1 to base in the loop until all test cases pass. That would work -- but is there a more formal mathematical explanation for your solution?