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.
yeah that was also part of my reasoning. but on this scale the time difference is negligible and it's easier to read. :shrug: i see people calling it 'clever' and iunno bout that
Sorting the input is also not needed. You need to know only two smallest numbers, which can be found in O(n). Sorting is O(n log n) and is more time consuming.
My first idea was to just use std::sort but... that's not fun.
I really liked this kata. It's a great example of a problem that looks nearly impossible (at least to compute in a reasonable time) until you take a deeper look into it. Ruby made this problem very simple once I learned the theory.
:shrug:
Damn that's clever
An explicit return in a one liner method, while techincally fine, doesn't feel very rubyish
I'd consider this to be the most correct and most Ruby-ish solution.
:)... Ha, ha, ha.. I love this sarcastic humor.
Well, you're not... wrong, I guess.