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.
The operators are already pre-defined.
I don't think having to write out the numbers from 1 to 10 are too much of an issue. It's more of a suggestion.
You are confusing
mod
(the%
operator) withabs
.And yes, this kata needs more tests.
While this may be true for some solutions, there is at least one solution that finishes nearly instantly, no matter the input.
Hey guys, I'm preparing for interview questions and I'm struggling at kyu 4. How hard the interview questions based on codewar question hardness ranking? Thanks!
A couple of people have made the same comment. Luckily C# and Java handle division by zero nicely (returns infinity), so you can return the result directly. For Python, I specified that you should return None, since it will otherwise result in an exception.
Same test since the beginning.
I have the same problem in python when trying to submit.
I guess tests are using a combination of k and n values which is a bit too big for float :(
I tried to use Decimal to wrap the failling calculation, and convert back the result to float - but I get back a systematic timeout from codewars.
But what is strange is that 161 of 772 of completed katas are in python ... so I guess there is a way to overcome that if nothing has changed recently.