Set .difference() Operation

Sort by

recency

|

373 Discussions

|

  • + 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))
    
  • + 0 comments

    dont trust the constraints they are the ones that gives them but doesnt follow them and even shows us the error(here they told the sum of them should be less than 1000 ) but at last they give test cases where the value exceeds.

  • + 0 comments

    For Python3 Platform

    n = int(input())
    english = set(map(int, input().split()))
    b = int(input())
    french = set(map(int, input().split()))
    
    print(len(english.difference(french)))