In this HackerRank Set .difference() Operation problem solution Students of District College have a subscription to English and French newspapers. Some students have subscribed to only the English newspaper, some have subscribed to only the French newspaper, and some have subscribed to both newspapers. You are given two sets of student roll numbers. One set has subscribed to the English newspaper, and one set has subscribed to the French newspaper. Your task is to find the total number of students who have subscribed to only English newspapers.

HackerRank Set .difference() Operation in python problem solution

HackerRank Set .difference() Operation in python problem solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
x = input()
en = set(map(int, raw_input().split()))
x = input()
print len(en - set(map(int, raw_input().split())))