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 is concise and nice to read, but becomes very slow for large arrays. Taking (1..1000000).to_a as an input, took nearly 5 min on my (old) machine.
No problem at all! But thanks for the note (and for the kata :-). I've submitted a modified solution, using the new method name.
I'll keep that in mind, thanks a lot!
Oh, I see. I tried a recursive solution and didn't think about keeping the input array intact. Thanks for the pointer :-)
I might be wrong, but it seems like the random tests (for Ruby) always expect the value of x as the return value.
Yes, was talking about Ruby. Sorry for not mentioning the language.
Works like a charm now. Thanks for the quick fix!
This comment is hidden because it contains spoiler information about the solution