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