Symmetric Difference

Sort by

recency

|

1249 Discussions

|

  • + 0 comments

    This did not pass the test cases. :-(

    a = input()
    lis_a = a.split()
    newlis_a = list(map(int, lis_a))
    set_a = set(newlis_a)
    print(set_a)
    
    b = input()
    lis_b = b.split()
    newlis_b = list(map(int, lis_b))
    set_b = set(newlis_b)
    print(set_b)
    
    result = sorted(list(set_a.difference(set_b).union(set_b.difference(set_a))))
    for i in result:
        print(i)
    
  • + 0 comments
    1. m=input()
    2. a=set(map(int,input().split()))
    3. n=input()
    4. b=set(map(int, input().split()))
    5. res=sorted(a.symmetric_difference(b))
    6. for i in res:
    7. print(i)
  • + 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)