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.
Enter your code here. Read input from STDIN. Print output to STDOUT
n, m = map(int, input().split())
elements = map(int, input().split())
arr = list(elements)
A = map(int, input().split())
A = set(A)
B = map(int, input().split())
B = set(B)
happiness = 0
for i in arr:
if i in A:
happiness += 1
elif i in B:
happiness -= 1
else:
happiness
No Idea!
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
n, m = map(int, input().split()) elements = map(int, input().split()) arr = list(elements) A = map(int, input().split()) A = set(A) B = map(int, input().split()) B = set(B) happiness = 0
for i in arr: if i in A: happiness += 1 elif i in B: happiness -= 1 else: happiness
print(happiness)