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.
Out of curiosity I ran a performance test comparing normal division with the division by bitwise shift in this case:
https://jsperf.com/numsum-division
The bitwise division is a little faster.
Very clever. I like the use of the shift operator to do the division.
Very cool, thanks!
Little math trick:
The sum of the first n natural numbers is equal to n(n + 1)/2