Ad
  • Custom User Avatar

    ok thanks, I´m going to correct that

  • Custom User Avatar

    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 array we... Bad practice, I told you:-) You should use another array to collect your results.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    (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