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.
This comment is hidden because it contains spoiler information about the solution
good task, the level corresponds to 7 kyu and the description is sufficient, gj
I know this can be done with int. Still this is great one-liner.
💪
loved it.
fixed
Scala tests:
Approved!
Scala translation
No, it doesn't.
Here's a profile of running this problem 10 million times with an if/if/if solution versus an if/elif/else solution:
Even if it did, if you care about nanoseconds you shouldn't be choosing different flow control syntax in Python, you should be choosing a different language.
if elif else statement works faster than if if if
For learning/reminder this is a good solution.
Yeah I fell into that trap too.
Please check my Java translation
Post your non working code: https://docs.codewars.com/training/troubleshooting#post-discourse so we can check what was wrong with it.
match
returnsnull
when there is no match.Loading more items...