You are viewing a single comment's thread. Return to all comments →
)
set1 = set(map(int,input().split()))
choice = int(input())
for _ in range(choice): op1, size = input().split() other_set = set(map(int, input().split()))
if op1 == 'intersection_update': set1.intersection_update(other_set) elif op1 == 'update': set1.update(other_set) elif op1 == 'symmetric_difference_update': set1.symmetric_difference_update(other_set) elif op1 == 'difference_update': set1.difference_update(other_set)
print(sum(set1))https://)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Set Mutations
You are viewing a single comment's thread. Return to all comments →
)
set1 = set(map(int,input().split()))
choice = int(input())
for _ in range(choice): op1, size = input().split() other_set = set(map(int, input().split()))
print(sum(set1))https://)