Set Mutations

  • + 0 comments

    Can we make it even more concise?

    _, A = input(), set(map(int, input().split())) 
    [getattr(A, input().split()[0])(set(map(int, input().split()))) for i in range(int(input()))]
    print(sum(A))