Set .intersection() Operation

Sort by

recency

|

433 Discussions

|

  • + 0 comments
    n = int(input())
    english = set(map(int, input().split()))
    b = int(input())
    french = set(map(int, input().split()))
    print(len(english.intersection(french)))
    
  • + 0 comments

    What is wrong with my code?

    n = input() d,a,c,b= n.splitlines() a = set(a.split()) b = set(b.split())

    x = a.intersection(b) l = len(x) print(l)

  • + 0 comments
    n,e,b,f = (set(input().split()) for _ in range(4))
    print(len(e&f))
    
  • + 1 comment

    n = int(input()) s = set(input().split()) N = int(input()) S = set(input().split()) print(len(s.intersection(S)))

  • + 0 comments

    n, a = int(input()), set(map(int, input().split())) m, b = int(input()), set(map(int, input().split()))

    print(len(b.intersection(a)))