You are viewing a single comment's thread. Return to all comments →
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(Nlis.symmetric_difference(Mlis))
for i in res: print(i)
Seems like cookies are disabled on this browser, please enable them to open this website
Symmetric Difference
You are viewing a single comment's thread. Return to all comments →
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)