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
This comment is hidden because it contains spoiler information about the solution
Agreed
better use an enumerate's argument for the start index
This comment is hidden because it contains spoiler information about the solution
This is an awesome little tidbit of information.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
@Unnamed, @Blind4Basics: There is a Guido's article about List Comprehensions and Generator Expressions advantages - http://python-history.blogspot.com/2010/06/from-list-comprehensions-to-generator.html
But yeah, it's more about comparison between LCs and (map with lambda). Thanks for correcting me
@Rishat Nuriev:
see the fork: no meaningful difference between the three versions (500 tests on one input of size 500x500). The 3 versions perform about the same. Sometimes one is faster than the others, but not always the same one. You'd need something far more precise to actually see any consistent difference.
@Unnamed: you don't use lambda in there, so no overhead on this side (which is often what is slowing this kind of approach, I believe).
2 Usually true.
1 Who told you that? I know Python folks don't like lambdas, but I haven't heard anything about
map
. One function call is easier to read than an expression where a new variable is introduced for no reason.I'm sure this should be best practice
This comment is hidden because it contains spoiler information about the solution
I think that we don't need to create a dictionary, a list is enough
Also no need to check if number is in the dict (easier to check if it's less or equal than 100)
Loading more items...