You are viewing a single comment's thread. Return to all comments →
The secret to this one is in the instructions:
lengths = list(map(int,input().split(" "))) current_array = list(map(int,input().split(" "))) a = set(map(int,input().strip().split(" "))) b = set(map(int,input().strip().split(" "))) happiness = 0
for i, n in enumerate(current_array): if n in a: happiness += 1 elif n in b: happiness -= 1
print(happiness)
Seems like cookies are disabled on this browser, please enable them to open this website
No Idea!
You are viewing a single comment's thread. Return to all comments →
The secret to this one is in the instructions:
lengths = list(map(int,input().split(" "))) current_array = list(map(int,input().split(" "))) a = set(map(int,input().strip().split(" "))) b = set(map(int,input().strip().split(" "))) happiness = 0
for i, n in enumerate(current_array): if n in a: happiness += 1 elif n in b: happiness -= 1
print(happiness)