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.
That's absolutely wrong[1][2].
easy to read == efficient
I guess your right! Wouldnt be surprised if this is how the min and max methods are written.
ahh the reverse keyword!
But... good looking has nothing to do with efficiency.
because they look nice!
Why?
This comment is hidden because it contains spoiler information about the solution
I wish I took this approach to math katas more
red pill or blue pill?
The algorithm correctly assumes that all numbers are either even or odd. Pretty sure all of our responses include some iteration of that same logic.
The algorithm correctly assumes that all numbers are either even or odd. slighty overcomplicated in my opinion but very cool indeed.
Even though I LOVE loops that is not needed here at all.. just a simple if statement.
Also, their response is probably faster than yours beacuse it boils down to a single math operation vs evaluating conditional statements and executing loops!