You are viewing a single comment's thread. Return to all comments →
A = int(input()) set_A = set(map(int,input().split())) B = int(input()) for _ in range(B): command = list(map(str, input().split())) set_B = set(map(int,input().split())) if command[0].lower() == 'intersection_update': set_A &= set_B elif command[0].lower() == 'update': set_A |= set_B elif command[0].lower() == 'symmetric_difference_update': set_A ^= set_B elif command[0].lower() == 'difference_update': set_A -= set_B print(sum(set_A))
Seems like cookies are disabled on this browser, please enable them to open this website
Set Mutations
You are viewing a single comment's thread. Return to all comments →