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

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