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

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

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