You are viewing a single comment's thread. Return to all comments →
Na = int(input()) A = set(map(int, input().split())) s = int(input()) for i in range(s): cmd = input().split() B = map(int, input().split()) if(cmd[0] == "intersection_update"): A.intersection_update(B) elif(cmd[0] == "update"): A.update(B) elif(cmd[0] == "symmetric_difference_update"): A.symmetric_difference_update(B) else: A.difference_update(B) print(sum(A))
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Set Mutations
You are viewing a single comment's thread. Return to all comments →
For Python3 Platform