You are viewing a single comment's thread. Return to all comments →
![](
M = int(input()) Mm = list(map(int, input().split()))
N = int(input()) Nn = list(map(int, input().split()))
diff_1 = set(Mm).difference(Nn) diff_2 = set(Nn).difference(Mm)
final_set =sorted(list(diff_2.union(diff_1)))
for i in range(len(final_set)): print(final_set[i])
https://)
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 = int(input()) Mm = list(map(int, input().split()))
N = int(input()) Nn = list(map(int, input().split()))
diff_1 = set(Mm).difference(Nn) diff_2 = set(Nn).difference(Mm)
final_set =sorted(list(diff_2.union(diff_1)))
for i in range(len(final_set)): print(final_set[i])