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.
It could be nice if we could vote for the most "pedagogical" solution, it may motivates players to write self explanatory code.
Structured and commented code is not what everybody writes, but if encouraged it may help beginners getting some key concepts.
I'd personaly have return 0: "If more than one valid result, return the smallest index."
They all have a score difference of 1, so why not take the smallest index ?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That makes sens :D
I figured out the error, my method ended with a "puts completed_DNA", instead of "return completed_DNA".
I'm also gonna dive into the Wiki later on.
Thanks for your answer, have a nice day :)
Hey there,
I'm such a noob that it's my 3rd attempt to post a comment (what kind of sorcery is this ? VIM ?!!). I started Ruby few weeks ago.
My code works perfectly on my machine, but return 100% errors on Codewars. Can anyone explain this behavior ?
I'm gonna try other ways to make it work (I choose to work with Ruby's hash data structure because I'd to discover & practice)
I'd like to share my code, but I dont even know how to do it nicely (as AJX117 did, for exemple)