You are viewing a single comment's thread. Return to all comments →
This is passing. The key is to assign A and B to a set in order to run the computation quickly enough to pass the tests.
n, m = map(int, input().split()) arr = map(int, input().split()) set_a = set(map(int, input().split())) set_b = set(map(int, input().split())) happiness = 0 for e in arr: if e in set_a: happiness += 1 elif e in set_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 →
This is passing. The key is to assign A and B to a set in order to run the computation quickly enough to pass the tests.