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.
Yes, that's what I also was thinking about!
And my tests with timeit also show that for loop is constantly faster
Can you point me in the right direction on how you performs tests like this?
my times for same are
positive_sum 33.97278720000759
positive_sum1 34.759848499903455
maybe you had bad luck for positive_sum generating only 1-digit numbers with random
This comment is hidden because it contains spoiler information about the solution
This code seems to be 15% faster than the CrazyMerlyn answer.
Awesome!
This piece of code only took 11.4 seconds to run. From 0 to 10000000.
This piece of code only took 4.22 seconds to run. From 0 to 10000000.
This piece of code took 16.64 seconds to run. From 0 to 10000000.
This piece of code only took 2.10 seconds to run. From 0 to 10000000.