Is there a quick function to find the disjoint union of three or more arrays like there is union and intersect? I have searched but can't find it.
a=[1,2,3,6,7]
b=[2,3,4]
c=[3,4,5,6,7]
un=union(a,b,c)
for i in union(intersect(a,b),intersect(b,c),intersect(a,c))
filter!(e->e!=i,un)
end
This give the correct answers un=[1,5] but surely there is a function?
The following calculates elements appearing only once in a vector list (and generalizes to more vectors):
For diversity's sake, here is a slower approach, but still succint:
This following version might actually be efficient: