Ad
  • Default User Avatar

    Thanks eventualy realised my mistakes, 1 being that i was only checking if the value was in the ofther array excluding the fact of duplicates and the other that if both arrays were empty i returned false.

    Thanks for the help ^^

  • Custom User Avatar

    That's an edge case and your first assumption is wrong. You're also missing some other part of the instructions, this one:

    whether the two arrays have the "same" elements, with the same multiplicities.

    Think about what that means.

    What would you return for this input? a = [4] b = [2, 2, 2]

    Sorry I'm being a little vague, but I'm giving you hints so you can solve the kata yourself.

  • Default User Avatar

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

  • Custom User Avatar

    You're confused by this:

    If a or b are empty then the result is self-evident.

    What should the expected value be if both are empty? Use console.log to print the input values.

  • Default User Avatar

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