Skip to content

Instantly share code, notes, and snippets.

@mightywombat
Last active December 24, 2020 21:16
Show Gist options
  • Save mightywombat/0e76b3e96033083ba51cdceafba5b9ee to your computer and use it in GitHub Desktop.
Save mightywombat/0e76b3e96033083ba51cdceafba5b9ee to your computer and use it in GitHub Desktop.
n = int(input())
s = set(map(int, input().split()))
N = int(input())
for i in range(N):
cmd=input().split()
if cmd[0]=="pop":
s.pop()
else:
s.cmd[0](int(cmd[1]))
print(sum(s))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment