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.
nice and cleas solution.
IMHO, it would've been perfect without named return
aha, that's where it was - thanks a lot for pointing out
It would be good to have a test where there are two words with the same raking.
For example I have adjusted one of the existing inputs to the following "what time are we climbing up the volcamp volcano"
If I understood the requirements correctly, then "volcamp" and "volcano" would have the same ranking
and thus "volcamp" should be selected, because it comes first in the input.
I believe that current top voted solution would fail above test.
a very neat solution indeed.
I am trying to figure out whether the following requirement is met: "If two words score the same, return the word that appears earliest in the original string."
In order to check it, I have modified one of the existing tests to have the following input: "what time are we climbing up the volcamp volcano"
If I understood the requirements correctly, then "volcamp" and "volcano" should have the same ratings and thus "volcamp" should be selected
because it comes first in the input.
I think current implementation would still select "volcano" though?