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.
Sure. I've added 2 examples and also a note to have a look at the sample tests.
Indeed. Thanks. I added a few test cases.
Thanks. I've added test cases for these.
Thanks, ZED.CWT. I added a few random test cases. Let me know if that's not good enough.
Does every kata need random tests? I'm not sure how to go about this.
Thanks, I've added a test case for that.
Typo: santized → sanitized
Great. I updated the kata so this won't happen to anyone else. Thanks!
This comment is hidden because it contains spoiler information about the solution
Done.
As for the third case: it contains two sentences. You'll have to divide the number of words by 2.
And as for why you're getting the message "should be -1.06 but was -1.06", I'm not sure. Are you returning strings? You could try calling
toFixed(2)
on the returned value.permutation
is not available like this in ruby 1.9.3.Your submitted solution works for me, inside codewars, and with ruby 1.8/1.9/2.0/2.1/jruby. I have no idea what the problem is.
However, the code snippet you posted is returning words in a different order than found in the dictionary. Your submitted solution fixes that (with a hack ;).
Returning an empty array is fine. You should try again: I upated the example test cases. If the tests pass, it should go through when submitting.
What test case would you add for instance?
Loading more items...