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.
The kata was more difficult than it seemed at first sight. Thanks for the interesting experience.
This comment is hidden because it contains spoiler information about the solution
I used a different implementation of the solution. In IDE the function returns the same "Winner!" but test message: "Expected: 'Loser!', instead got: 'Winner!'"
The input data above should return'Winner!'
Random tests
Testing for DSYLTWUI,87,TQDV,79,MKUVZJN,77,JGICV,87 and 1
Log
[ [ 'DSYLTWUI', 87 ],
[ 'TQDV', 79 ],
[ 'MKUVZJN', 77 ],
[ 'JGICV', 87 ] ] 1
It should work for random inputs too - Expected: 'Loser!', instead got: 'Winner!'
Why 'Loser!'?
This comment is hidden because it contains spoiler information about the solution
This kata should have a "Mathematics" tag :-)
In any case, the code above can give a name consisting of 4 digits.
Numbers in the basic tests:
assert.deepEqual(friend(["Ryan", "Jimmy", "123", "4", "Cool Man"]), ["Ryan"])
Why is this solution the most popular? The case of "1234" will be valid, although the kata condition does not allow it: "If a name has exactly 4 letters"
The easiest solution without hardcode.
Just incorrect description. Need to check the total length s1 and s2
/* expected 'abdefgilnoprstu' to equal 'abcdefghilnoprstu' */
Incorrect test. The letter C is missing in input