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
This comment is hidden because it contains spoiler information about the solution
wise word
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thanks, I will
Try this kata?
ok, I'm becoming a true believer. I see a pattern of the highest rankings going to the solutions that can do it in one line, which is not a valid measure for value of the code. It often leads to the most maintainable code, but rarely to the most efficient solution. In this case I profiles my solution against this solution and found this solution to be 33% faster.
I remain skeptical, especially of the solutions relying on multiple string conversions, but I applaud this solution.
This is a very efficient solution. The only change I would recommend is to use n&1 instead of suffering the cost of a division for n%2