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.
This is not the short/best method, but will be easy for beginners to understand. i explained step by step with comments in #
#inputM=int(input())m=input()N=int(input())n=input()#splitting and mapping(string to int_list)x=list(map(int,m.split()))y=list(map(int,n.split()))#creation of setsa=set(x)b=set(y)#difference in each setsc=a.difference(b)d=b.difference(a)#union of differencee=c.union(d)#converting set to a listresult=list(e)#sortingresult.sort()#iterationforiinrange(len(result)):print(result[i])
Symmetric Difference
You are viewing a single comment's thread. Return to all comments →
This is not the short/best method, but will be easy for beginners to understand. i explained step by step with comments in #