I'm looking for a way to find the unique items between several sets. For example, take these 3 sets.
x = {1, 2}
y = {1, 3}
z = {1, 3, 4, 5}
How can I find the unique items? I'm looking for something like this.
findunique(x, y, z) # {2, 4, 5}
I tried using symmetric_difference
with reduce
, but that ended up returning {1, 2, 4, 5}
.
The only other thing I can think of is to have a dict
keep track of how many counts there are for each item, and return only the ones with 1 count. However, that seems very inefficient and unpythonic. What's the "right" way to go about this?