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=list(map(int,input().split()))
arr=list(map(int,input().split()))
A,B=set(map(int,input().split())),set(map(int,input().split()))
a,b=[x for x in arr if x in A],[x for x in arr if x in B]
print(len(a)-len(b))
A oneliner:
x = list(map(int, input().split())) my_set = list(map(int, input().split())) set_A = list(map(int, input().split())) set_B = list(map(int, input().split())) score = 0
for i in my_set: if i in set_A: score += 1 if i in set_B: score -= 1
print(score)
the time limit is exceeding, any help with that
the
using a dictionary