Ad
  • Default User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    Was it intended, I had to write the tests by myself? Kinda odd... I had to gather the information from other programming language versions to create the right test cases.

  • Custom User Avatar

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

  • Custom User Avatar

    well, the wording might be a bit edgy, yes. That's why there are examples. ;)

  • Custom User Avatar

    According to description everything is okay, what i mean is array difference sounds like a different thing, anyway thanks :)

  • Custom User Avatar

    If a value is present in b, all of its occurrences must be removed from the other:

    array_diff([1,2,2,2,3],[2]) == [1,3]

  • Custom User Avatar

    Correction: you "don't understand why"... ;) Because you'd bet that with thausends of completions, the description and the examples are correct.

    It should remove all values from list a, which are present in list b.

    a = [1,2,2]
    b = [2]
    
    apply the rule above => only [1] remains
    
  • Custom User Avatar

    I don't think that the array difference of [1,2,2] from [2] is [1]. [1,2] seems the right answer? Am i thinking wrong?