Symmetric Difference

Sort by

recency

|

1238 Discussions

|

  • + 0 comments
    m=int(input())
    a=set(map(int,input().split()))
    n=int(input())
    b=set(map(int,input().split()))
    a_b=sorted(a.symmetric_difference(b))
    for num in a_b:
        print(num)
    
  • + 0 comments

    print(*(lambda m, set_m, n, set_n : sorted(set_m.symmetric_difference(set_n)))(input(), set(map(int, input().split())), input(), set(map(int, input().split()))), sep="\n")

  • + 0 comments

    Great way to get hands-on practice with Python sets and understand their practical use. Looking forward to more challenges like this! Cricbet99 login id and password

  • + 0 comments
    _ = input()
    m = set(map(int, input().split()))
    _ = input()
    n = set(map(int, input().split()))
    
    for num in sorted(list(m.symmetric_difference(n))):
        print(num)
    
  • + 0 comments

    M, m = int(input()), set(list(map(int,input().split()))) N, n = int(input()), set(list(map(int,input().split())))

    for i in sorted(m.symmetric_difference(n)): print(i)