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.
actually, #digit and #sum are two different methods, chained together. one of the beautiful things about Ruby!
i never knew of this #digit method, this is awesome!
very clever!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
smooth code, amazing!
errr... "lol"? ;)
There are many problems here you'll never solve if you don't pay attention to performances. When you'll hit blue (recent) or even some 5 kyus (very recent), yu may change your mind about that.
And for instance the present problem has an efficient solution that is perfectly readable and easy to understand, so, "not an argument". ;p
@Blind4Basics I don't think that neither ruby code nor codewars is about writing efficient code, rather it's about writting a readable, easy to understand code.
This comment is hidden because it contains spoiler information about the solution
@tkimia, no problem! ;)
@bestwebua. Sorry for the confusing sentence structure. I meant that your answer makes much more sense.
@tkimia, what about case when your ordering sring will have more then 100 chars? What the magic numbers in block???
then you don't understand anything to time complexity, man... :/
The current best answer and I both chose arbitrarily large numbers on the right hand of the
||
, but this makes much more sense.This comment is hidden because it contains spoiler information about the solution