Symmetric Difference

Sort by

recency

|

1247 Discussions

|

  • + 0 comments
    • M=int(input())
    • a=set(map(int,input().split()))
    • N=int(input())
    • b=set(map(int,input().split()))
    • result=sorted(a^b)
    • for num in result:
    • print(num)
  • + 0 comments

    P = input() W = set(map(int, input().split())) U = input() S = set(map(int, input().split()))

    for i in sorted(W^S): print(i)

  • + 0 comments
    a = set(map(int, input().split()))
    N = input()
    b = set(map(int, input().split()))
    
    for i in sorted(a^b):
        print(i)
    
  • + 0 comments
    M = input()
    a = set(map(int, input().split()))
    N = input()
    b = set(map(int, input().split()))
    
    result = sorted(a^b)
    
    for i in result:
        print(i)
    
  • + 0 comments

    could have done it without the loop, but too many brackets don't look good

    M = input()
    M = set(map(int, input().split()))
    N = input()
    N = set(map(int, input().split()))
    S = sorted((M.difference(N)).union(N.difference(M)))
    for val in S:
        print(val)