We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Symmetric Difference
- Discussions
Symmetric Difference
Symmetric Difference
Sort by
recency
|
1215 Discussions
|
Please Login in order to post a comment
M = int(input()) a = set(map(int, input().split()))
N = int(input()) b = set(map(int, input().split()))
value = a.difference(b) value.update(b.difference(a))
for i in sorted(value): print(i)
M = input() a = input() N = input() b = input()
Mlis = set(map(int, a.split())) Nlis = set(map(int, b.split()))
a1 = Mlis.difference(Nlis) b1 = Nlis.difference(Mlis)
res = sorted((a1.union(b1)))
res = sorted(Nlis.symmetric_difference(Mlis))
for i in res: print(i)