Confusion with symmstric difference

I am currently trying the symmetric difference challenge in the advanced algorithm scripting section. If I understood correctly, then the symmetric difference is the collection of elements contained in either one of a certain number of collections, but NOT in all of them.

Then how is sym([1, 2, 5], [2, 3, 5], [3, 4, 5]) supposed to return [1, 4, 5]? It says so in the test results of the challenge, but the 5 is an all three of the aforementioned arrays and, according to the definition, then it would NOT be returned.

What did I get wrong?

Thank you :slight_smile:

Symmetric difference is computed between 2 sets , and they are then chained in the order of the sets given so , symmetric difference between [1,2,5] & [2,3,5] = [1,3] and then symmetric difference between [1,3] & [3,4,5] = [1,4,5]

1 Like

Thank you, that explains a lot to me. Going to try again with the challenge :smiley: