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 .intersection() Operation
Set .intersection() Operation
Sort by
recency
|
410 Discussions
|
Please Login in order to post a comment
Anirudh Kuppam
n=int(input()) english=set(map(int,input().split())) b=int(input()) french=set(map(int,input().split())) inter_section=english&french length=len(inter_section) print(length)
n=int(input()) n=set(map(int,input().split())) b=int(input()) b=set(map(int,input().split()))
print(len(n.intersection(b)))
n_amount = int(input()) n = set(map(int,input().split())) b_amount = int(input()) b = set(map(int,input().split()))
c = n.intersection(b) print(len(c))
Wouldn't be Pythonic without 1 liner