Ad
  • Custom User Avatar

    Then your code is not correct, you're trying to read the length of something (null) that hasn't that property. You need to check what the value is first.

  • Custom User Avatar

    the error is : Cannot read property 'length' of null. But all the test are fine. Help me please.

  • Default User Avatar

    Would you mind reading the error..? And telling us what it is? :P

  • Custom User Avatar

    Hi, the test cases do pass null for one of the arrays in a couple of tests, so you can't make the arguments required unless you supply a default value. As far as your tests not passing in the test case, are you by chance modifying the source arrays in your code? The arrays are passed by reference so modifying the arrays in the random tests could affect how the reference solution behaves in the test suite. Can you be more specific about which test is failing when you run your code?

  • Custom User Avatar

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

  • Custom User Avatar

    Welcome Andrey, please, mark your posts as having spoiler content when posting code like that and also read how to use markdown formatting so your code doesn't lose indentation.

    To debug your code use print. About your code, you're comparing two lists with ==, that's not "regardless of the order". Maybe there are more problems once you fix that.

  • Custom User Avatar

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

  • Default User Avatar

    I was able to finish this kata with an algorithm, that doesnt fit the description, because the test are not good enough.

  • Default User Avatar

    It is. I just finished it