Skip to content

Instantly share code, notes, and snippets.

@meet100ni
Created May 13, 2020 13:10
Show Gist options
  • Save meet100ni/09db9e19d3d45e50bb0da496e5eed6a9 to your computer and use it in GitHub Desktop.
Save meet100ni/09db9e19d3d45e50bb0da496e5eed6a9 to your computer and use it in GitHub Desktop.
Set Mutations HackerRank Solution
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