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.
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.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.