You are viewing a single comment's thread. Return to all comments →
n= int(input()) A= set(map(int, input().split())) N= int(input()) for i in range(N): operation, no_of_elements = input().split() other_set= set(map(int, input().split())) getattr(A,operation)(other_set) # This has now modified set A 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 →