Created
May 13, 2020 13:10
-
-
Save meet100ni/09db9e19d3d45e50bb0da496e5eed6a9 to your computer and use it in GitHub Desktop.
Set Mutations HackerRank Solution
This file contains 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
if __name__ == '__main__': | |
(_, A) = (int(input()),set(map(int, input().split()))) | |
B = int(input()) | |
for _ in range(B): | |
(command, newSet) = (input().split()[0],set(map(int, input().split()))) | |
getattr(A, command)(newSet) | |
print (sum(A)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment