Symmetric Difference

Sort by

recency

|

1225 Discussions

|

  • + 0 comments
    M= int(input())
    a= set(list(map(int, input().split())))
    N= int(input())
    b= set(list(map(int,input().split())))
    
    answer= list(a.difference(b).union(b.difference(a)))
    answer.sort()
    for numero in answer:
        print(numero)
    
  • + 0 comments

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

    sym = a.symmetric_difference(b) results = sorted(sym) for result in results: print(result)

  • + 0 comments
    m, set_m = input(), set(map(int, input().split()))
    n, set_n = input(), set(map(int, input().split()))
    diff = set_m.symmetric_difference(set_n)
    print(*sorted(diff), sep='\n')
    
  • + 0 comments
    m, set_m = input(), set(map(int, input().split()))
    n, set_n = input(), set(map(int, input().split()))
    diff = set_m.symmetric_difference(set_n)
    print(*sorted(diff), sep='\n')
    
  • + 0 comments
    1. M = input()
    2. N = set(map(int,input().split()))
    3. O = int(input())
    4. P = set(map(int,input().split()))
    5. not_common = N ^ P
    6. li = sorted(not_common)
    7. for i in li:
    8. print(i)