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.
there's a rounding error. for this value of
N
,log(N-1, 3)
should return 10, but because floating point is used, it returns 9.999999998, which rounds down to 9.0.Should have more test cases, including random ones to make it harder to hack.
provide some random cases or randomise the order of the cases so that it can't be hacked (see hacker sakana's solution).
problem could also be made harder by making the function accept any N by N square as input, not just a 3 by 3 square.
have added random test cases. thanks!
thanks for the suggestion! let me see what i can do to improve it.
you're right: i have amended the test suite to say "Large integers" instead. thanks!
Some spelling mistakes. Also, the command for pi in python is math.pi, not Math.PI