You are viewing a single comment's thread. Return to all comments →
Here's my code:
n, s = int(input()), set(map(int, input().split())) for i in range(int(input())): f, _, v = input().partition(' ') if not hasattr(set, f): continue getattr(s, f)(int(v)) if v else getattr(s, f)() print(sum(s))
Seems like cookies are disabled on this browser, please enable them to open this website
Set .discard(), .remove() & .pop()
You are viewing a single comment's thread. Return to all comments →
Here's my code: