Ad
  • Custom User Avatar

    You're also confusing the test input, console.log comes before the test result, the input you're seeing is of the next test, not from the test you failed.

  • Custom User Avatar

    I got this test failed too. I use console.log to print out the input arrays a and b , I found that this failed test ( a was [1,2,2], b was [2], expected [1] ) is caused by wrong input... The test says b is [2], but exactly b is [] from log.

  • Custom User Avatar

    @kinluek mutating the array you use in a loop is never a good idea, you'll be skipping values like that, it's not a kata issue, it's a problem with your code.

  • Custom User Avatar

    Your solution looks good, especially the comments! Stick with it ^.^

  • Default User Avatar

    yeh! I'm new to coding so didn't know about the whole object comparison thing

  • Default User Avatar

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

  • Custom User Avatar

    can somebody help me with my code? it passes all tests apart from the randomized string test.

  • Custom User Avatar

    Just saw this. I noticed you have a solution for the kata. Seems like you figured it out ^.^

  • Custom User Avatar

    I liked the Kata even tho my solution ended up being probably fairly inelegant and inneficient.

    The only problem i have with it is i found the exemple given in the description lacking, at first i thought only number from 1-9 could appear in the array and that the returned array should always be of length 10. Had to hack and duck tape my original solution. but its still a nice problem maybe if you gave an example that show an integer above 9 in the array to pass through the function airheads like me would get the problem faster :p.

  • Default User Avatar

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

  • Custom User Avatar

    I also get the same error on the same test, and if I change the sample tests to the one above it checks out.

    (EDIT) Our code is wrong - b.length can be shorter than a.length, so it stops by the first iteration

  • Custom User Avatar

    the code is in javascript, could you please take a look at it for me and see what the problem is? thanks

  • Default User Avatar

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

  • Custom User Avatar
    1. You may be mutating the input which leads to unexpected behaviour (wrong result).
    2. If this is not the case, specify the language please.

    Edit: JS working totally fine for me, and the tests are not flawed in any way. You can post your code here with a spoiler tag if you require some help as most probably your code is doing something wrong.

  • Default User Avatar

    for some reason when I attempt I get this error message on test 3: a was [1,2,2], b was [2], expected [1], however when I have put these values for a and b in the sample tests I get the right answer, [1], so i think there is a bug in the final test

  • Loading more items...