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.
n, m = map(int, input().split())
arr1 = list(map(int, input().split()))
A = set(map(int, input().split()))
B = set(map(int, input().split()))
happiness = 0
for i in arr1:
if i in A:
happiness+=1
elif i in B:
happiness-=1
print(happinesss)
Enter your code here. Read input from STDIN. Print output to STDOUT
n,m = map(int,input().split())
array = list(map(int,input().split()))
A = set(map(int,input().split()))
B = set(map(int,input().split()))
happiness = 0
for i in array:
if i in A:
happiness += 1
if i in B:
happiness -= 1
else:
happiness = happiness
print(happiness)
# Enter your code here. Read input from STDIN. Print output to STDOUTn,m=map(int,input().split())arrn=list(map(int,input().split()))# 2 disjoint setsAt=set(map(int,input().split()))Bt=set(map(int,input().split()))happy=0foriinarrn:ifiinAt:happy+=1ifiinBt:happy-=1else:happy=happyprint(happy)
n, m = map(int, input().split()) arr1 = list(map(int, input().split())) A = set(map(int, input().split())) B = set(map(int, input().split())) happiness = 0 for i in arr1: if i in A: happiness+=1 elif i in B: happiness-=1 print(happinesss)
Enter your code here. Read input from STDIN. Print output to STDOUT
n,m = map(int,input().split()) array = list(map(int,input().split())) A = set(map(int,input().split())) B = set(map(int,input().split())) happiness = 0 for i in array: if i in A: happiness += 1 if i in B: happiness -= 1 else: happiness = happiness print(happiness)
Hi there! Solution with sets