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.

  • Custom 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?

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

    Thank you so much!
    I missed that instruction. I coded the function by matching at least one value and not "exactly one" value as 1:1.
    Thanks again!

  • Custom User Avatar

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

  • Custom User Avatar

    I already spent too much time trying to figure this one out so I am reaching to another pair of eyes:
    Basic test # 9 is passing these 2 arrays:
    [ 2, 2, 3 ]
    [ 4, 9, 9 ]
    My code returns true but the test fails because:
    Expected: false, instead got: true

    Can someone help?