You are viewing a single comment's thread. Return to all comments →
m = int(input()) a = set(map(int, input().split())) n = int(input()) for _ in range(n): op, k = input().split() s = set(map(int, input().split())) if op == "intersection_update": a.intersection_update(s) elif op == "update": a.update(s) elif op == "symmetric_difference_update": a.symmetric_difference_update(s) elif op == "difference_update": a.difference_update(s) else: raise ValueError print(sum(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 →