Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Nice kata. I was afraid my solution was unnecessarily complicated but when it ran in less than 1s I was happy :)
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 :)
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?
This comment is hidden because it contains spoiler information about the solution
Its 5 per test.
How many assertions per test? In my 100 random tests I've got 255 assertions passed but still timing out.
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