Set .difference() Operation

Sort by

recency

|

375 Discussions

|

  • + 0 comments
    n,a,m,b = int(input()),set(input().split()),int(input()),set(input().split())
    print(len(a-b))
    
  • + 0 comments
    n,a,m,b = int(input()),set(input().split()),int(input()),set(input().split())
    print(len(a.difference(b)))
    
  • + 0 comments

    Here is HackerRank Set .difference() Operation in Python solution - https://programmingoneonone.com/hackerrank-set-difference-operation-solution-in-python.html

  • + 0 comments
    m=input()
    l=set(map(int,input().split()))
    n=input()
    s=set(map(int,input().split()))
    print(len(l.difference(s)))
    
  • + 0 comments
    n=input()
    e=set(input().split())
    b=input()
    f=set(input().split())
    print(len(e-f))