Stone Division, Revisited

  • + 1 comment

    In the given case, there was no pile of 32 stones, that was one part of my confusion. So

    1x64 => 4x16 1 move
    4x16 => 8x8 4 moves
    8x8 => 16x4 8 moves
    16x4 => 32x2 16 moves
    

    making it 1+4+8+16, 29 moves, so the number is accurate.

    Other parts were confusing and , and missing memoization (wanted to have correct answer first, but the memoization itself is trivial)