jmpark0118 / CODING_TEST_PRACTICE

0 stars 0 forks source link

Practice>Python>Sets>Set Mutations #67

Open jmpark0118 opened 4 years ago

jmpark0118 commented 4 years ago

image image image image

출처 : https://www.hackerrank.com/challenges/py-set-mutations/problem

jmpark0118 commented 4 years ago

if __name__ == '__main__':
    a_count = int(input())
    A = set(map(int, input().split()))

    number_of_sets = int(input())

    for i in range(number_of_sets):
        operation, b_count = input().split()
        B = set(map(int, input().split()))
        command = 'A.' + operation + '(B)'

        exec(command)

    print(sum(A))