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
do we really need that kind/level of optimization, tho...? 'XD
Performance wise, this implementation is likely to perform slightly better than solutions that have branches.
I won't advocate for changing production code everywhere to eliminate branches, but it's both interesting and important to note when every last cycle matters.
https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-processing-an-unsorted-array
Awesome! Thanks for code.
Hello there!
The idea of that solution is from the book "C Programming Language by Kernighan and Ritchie" Part 1.5.4.
It's a good way to start thinking how functions work.
Using .split method is more preferable since it's much easy to make a mistake in such a huge code above.