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.
Absolutely. Best solution of all.
This comment is hidden because it contains spoiler information about the solution
I like the logic behind your solution. Very similar to mine
what about now
This comment is hidden because it contains spoiler information about the solution
yes. apparently the tests don't catch O(n^2) solutions despite the description.
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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Because you have to do a lot by hand, it's really usefull !
Many methods in Python take an iterable as their argument (this is usually noted in the signature description in the documentation). A generator expression is, much like a list, iterable. Therefore it is not necessary to actually construct a list (neither explicitly or via list comprehension), in fact it simply uses up more memory.
Yes, it does work without square brackets. I just checked, because I got identical solution except of square brackets I got
list()
. After removinglist()
it still works.why?
actually, there are useless sets in there too. See the fork to avoid them.
Loading more items...