Created
October 4, 2021 21:59
-
-
Save elowy01/1b83623a7c84529617d824fb341bc685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.hackerrank.com/challenges/py-set-discard-remove-pop/problem | |
Solution: | |
n = int(input()) | |
s = set(map(int, input().split())) | |
for _ in range(int(input())): | |
elms= input().split() | |
if len(elms)>1: | |
eval(f"s.{elms[0]}({elms[1]})") | |
else: | |
eval(f"s.{elms[0]}()") | |
print(sum(s)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment