Set .difference() Operation

Sort by

recency

|

360 Discussions

|

  • + 0 comments

    input() english_newspaper = set(input().split()) input() french_newspaper = set(input().split())

    print(len(english_newspaper.difference(french_newspaper)))

  • + 0 comments

    Enter your code here. Read input from STDIN. Print output to STDOUT

    n = int(input()) eng = set(map(int, input().split()))

    m = int(input()) french = set(map(int, input().split()))

    diff = eng.difference(french) print(len(diff))

  • + 0 comments

    s=int(input()) set1=set(map(int,input().split(" "))) a= int(input()) set2=set(map(int,input().split(" "))) print(len(set1- set2))

  • + 0 comments

    Here's my code:

    el = int(input())
    e = list(map(int, input().split()))[:el]
    fl = int(input())
    f = list(map(int, input().split()))[:fl]
    print(len(list(set(e).difference(f))))
    
  • + 0 comments

    english = int(input()) english_s = set(list(map(int, input().split()))) france = int(input()) france_s = set(list(map(int, input().split()))) print(len(english_s.difference(france_s)))