You are viewing a single comment's thread. Return to all comments →
m,a=int(input()),input().split() n,b=int(input()),input().split() a_set=set(a) b_set=set(b) a_dif=a_set.difference(b_set) b_dif=b_set.difference(a_set) all_union=a_dif.union(b_dif) print("\n".join(sorted(all_union,key=int)))
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,a=int(input()),input().split() n,b=int(input()),input().split() a_set=set(a) b_set=set(b) a_dif=a_set.difference(b_set) b_dif=b_set.difference(a_set) all_union=a_dif.union(b_dif) print("\n".join(sorted(all_union,key=int)))