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.
Because the description specifies a tiebreaker for identical score differences.
is
num
a string?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 ?
You are right, the best match is the 5th one. But you should return the index, which is 4 in this case.
Oops, fixed :)
You've written a2 instead of a1 at the end of the first sentence.
I've updated the description so hopefully it makes things clearer.
See the first letter of the animals of a1 and the output arrays
I'm having the same problem
Test.assert_equals(duplicate_encode('Test'), ')(()')
Don`t use each_char. Use .split("").each
I'll leave it to you to figure out what this means :)
Hi @jhughessuta, I'm unable to see your code so cannot help, sorry.