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.
This comment is hidden because it contains spoiler information about the solution
For those are confused by instruction
done
Because the author doesn't mention it and everyone is lazy pretty much
The kata was more difficult than it seemed at first sight. Thanks for the interesting experience.
The user can mutate the input affecting the expected value at least in javascript. Calculate the expected value before calling the user's function.
Probably that's because that solution mutates the input, affecting the expected value.
This comment is hidden because it contains spoiler information about the solution
Post your code that fails: https://docs.codewars.com/training/troubleshooting#post-discourse so it can be checked.
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!'
No idea what you're doing but, you passed the kata and with your current code I can't reproduce that error. The control function returns
"Winner!"
for that input too. You can see that for yourself.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"])
Loading more items...