We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Set .discard(), .remove() & .pop()
Set .discard(), .remove() & .pop()
Sort by
recency
|
1091 Discussions
|
Please Login in order to post a comment
I also wanted to use lamda but realized there was a problem I saw before which also required dynamic function call like this. Studied getattr()() workings and here is a much much simpler way
For Python3 Platform
n = int(input()) s = set(map(int, input().split())) N = int(input())
for _ in range(N): cmd = input().split()
print(sum(s))
change your language to python3 from pypy3 for correct result
For Python3 Platform