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.
Great kata! Fell into the "premature optimization" trap before solving this one, so it took a while, but I really enjoyed the problem.
The kata does not seem to work! My suolution was to just return 2, and it passed all tests. So, unless the laws of probability are greatly in my favour there is probably a problem with the tests somewhere...
Simply beautiful! I still can't really visualise how or why this works, but the brevity and efficienty is just amazing!