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
|
458 Discussions
|
Please Login in order to post a comment
a=input() //If m contains more element than a , It is not occur an error. // this logic only for no of elements not specific no of elements
m=set([int(i) for i in input().split()]) b=input() n=set([int(i) for i in input().split()]) print(len(m&n))
Here is HackerRank Set .intersection() Operation in python solution - https://programmingoneonone.com/hackerrank-set-intersection-operation-solution-in-python.html