Symmetric Difference

Sort by

recency

|

1240 Discussions

|

  • + 0 comments
    m = int(input())
    a = set(map(int, input().split()))
    n = int(input())
    b = set(map(int, input().split()))
    res = a.difference(b).union(b.difference(a))
    for i in sorted(res):
        print(i)
    
  • + 0 comments

    m = int(input()) m1 = set(map(int,input().split())) n = int(input()) n1 = set(map(int,input().split())) m1_n1 = sorted(m1.symmetric_difference(n1)) for i in m1_n1: print(i)

  • + 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")

  • + 1 comment

    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