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.
Tested this solution and the one with sum(range(1, num + 1)), so with argument of 1000, I had these results:
range: 14.2409 sec
formula: 0.1098 sec
I know this is obvious, I shared it just for anybody who is curious
this is going in the locker, I did not know this.
I swear everytime, the top answer is just the same thing I did but with list comprehension. I need to use this feature more.
This comment is hidden because it contains spoiler information about the solution
can someone explain it?
One of the best!
Easy one, gj
Quick Maffs!
Mate, this is the most intriguing and clever ways to solve this problem of summation. Hats off to you!
Great! Five year in Python and only now I find that you don't get an "index out of range" on slicing!
Pure math is alsways in theory faster. Learned this algo from a friend of mine, will always remember it for sum of range problems starting at 0 or 1
very very clever
This comment is hidden because it contains spoiler information about the solution
Comprehensive list are the best. I've a similar solution. Go check.
i like the unusual way
Loading more items...