We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Set .difference() Operation
- Discussions
Set .difference() Operation
Set .difference() Operation
Sort by
recency
|
334 Discussions
|
Please Login in order to post a comment
We are given a contraint in the question: 0
Enter your code here. Read input from STDIN. Print output to STDOUT
n_E = int(input())
L_E = list(map(int, input().split()))
n_F = int(input())
L_F = list(map(int, input().split()))
count = 0
R=[]
for x in L_E:
if not x in L_F:
count+=1
R.append(x)
else:
continue
print(count)
n_E = int(input()) L_E = set(map(int, input().split())) n_F = int(input()) L_F = set(map(int, input().split()))
print(len(L_E.difference(L_F)))
n = int(input()) set_n = set(input().split()) b = int(input()) set_b = set(input().split())
print(len(set_n - set_b))