Ad
  • Default User Avatar

    Nice kata. I was afraid my solution was unnecessarily complicated but when it ran in less than 1s I was happy :)

  • Default User Avatar

    Thanks @benjaminzwhite.
    Indeed I should have checked it more thoroughly. I'll be more critical before raising an issue next time. Or just not mark any comment as issue!
    In this case, I doubt I would have realized what was going wrong if not for the operations you used in your comment.
    On the bright side, today I learnt about long integer division error in Python :)

  • Default User Avatar

    My solution breaks for numbers > 10^18 with the error "not a valid representation using only binomial coefficients

    Example:
    961046579609841869 = [961046576024667392, 3580145271, 5029206]

    However each of the numbers is a valid binomial coefficient. Ran the same check that 8 * n + 1 is a perfect square.
    Since the tester uses the bitwise operation x<<3, is it possible the leftmost bits are getting dropped at large numbers?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Its 5 per test.

  • Default User Avatar

    How many assertions per test? In my 100 random tests I've got 255 assertions passed but still timing out.

  • Default User Avatar

    Heads up. Both left and right are included in the count. I wasted nearly an hour wondering why my result was off by a tiny amount