Ad
  • Custom User Avatar

    Then what does "with the same multiplicities" mean? Isn't "multiplicities" the amount? I'm not native English speaker, so excuse me if I misunderstood it.

  • Default User Avatar

    No. Instructions say "Same" means that the elements in b are the same elements in a, squared. Thus, you could say if b = [ 16, 16, 16, 16, 16, 16, 16] and a = [4], this qualifies as "same" since the elements in b are the same as in a, but squared. There is no 1:1 ratio happening and if there is, its extremely poorly worded. Even looking at the first example of valid arrays you see multiples of squares, thus 1:1 cannot be true. And if it was, my solution would fail.

  • Custom User Avatar

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

    the same multiplicities - doesn't it mean the same amount for each num and its square?

  • Default User Avatar

    The question doesnt ask for 1:1 though. I am coding mine without doing 1:1 and it works fine (except for an issue with null/empty which i cant figure out).

  • Custom User Avatar

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