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.
ok thanks, I´m going to correct that
In that line:
we[i] = (names[i].length + names[i].toLowerCase().split('').map(.........;
you are modifying the input array
we
so the program will go on with a bad arraywe
... Bad practice, I told you:-) You should use another array to collect your results.This comment is hidden because it contains spoiler information about the solution
I don't understand what happened.
I ran your example with the random tests solution and it gives the result as "William":
Test.assertEquals(refRandomTestSol("William,Aubrey,Michael", [3,1,6], 2), "Aubrey");
(false result "Aubrey" to see if we get the correct "William")returns:
Failed 1
Expected: 'Aubrey', instead got: 'William'
this shows that the good result is effectively "William" with the refrence solution used by the random tests.Maybe you should try again. If you want you can give your solution (mark it with spoiler) and I will try it. 49 guys passed the JS kata. I am afraid your code modify the input. It happens oftn with beginners but it is very bad practice.
Tell me, please.
(JavaScript)
Hey I tried to make this kata but when the solution is evaluated with randoms say me that the name is wrong, i checked manually and the solution is correctly
Example:
Testing Rank: William,Aubrey,Michael, [3,1,6], 2
Solution:
[ 348, 258, 78 ]
[ 'Michael', 'William', 'Aubrey' ]
Result:
✘ It should work for random tests too - Expected: 'Aubrey', instead got: 'William'
Note:
The problem is only with randoms