Set .intersection() Operation

  • + 0 comments

    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))