Set Mutations

  • + 0 comments

    m = int(input()) A = input() n = int(input())

    setA = set(map(int, A.split()))

    for i in range(n): line1 = input() B = input()

    words= line1.split()
    op = words[0] 
    np = int(words[1])
    
    list2= B.split()
    setB = set(map(int, list2))
    #setA= setA.op(setB)
    getattr(setA, op)(setB)
    

    sum = 0 for i in setA: sum = sum + i print(sum)