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
But that's exactly what a best practive is — chosing the best-suited answer from a number of different ones.
In my real code I would like to have this one, not any other one. Thus, this is the best practice.
(And yes, googling for the formula instead of taking a straightforward looping path is a good habit to have, IMO.)
Fixed.
I should be ashamed, taking in account I've been pointed on the same issue 3 months ago.
Thanks for your feedback.
I guess the tests are already fixed.
Great, more clever than original one I've suggested!
Perharps
each_with_index {|method, i|
instead ofeach_index {|i|
andself*10+i
instead of(self.to_s+i.to_s).to_i
can make it even more efficient.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Pretty destructive, I must aassume.