Symmetric Difference

Sort by

recency

|

1206 Discussions

|

  • + 0 comments
    n=int(input())
    set1=set(map(int, input().split()[:n]))
    m=int(input())
    set2=set(map(int, input().split()[:m]))
    result=sorted(set1^set2)
    for i in result:
        print(i)
    
  • + 0 comments

    m = int(input())

    a = set(map(int, input().split()[:m]))

    n = int(input())

    b = set(map(int, input().split()[:n]))

    result = a ^ b

    for item in sorted(result):

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

    _, a, _, b = int(input()), set(map(int, input().split())), int(input()), set(map(int, input().split()))

    print(*sorted(a.difference(b).union(b.difference(a))), sep='\n')

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