You are viewing a single comment's thread. Return to all comments →
this code passed all test cases, this approach did'nt use list comprehension. solution in python 3
` len_int = list(map(int,input().split(" "))) n , m = len_int[0], len_int[1]
like_num = list(map(int,input().split(" "))) A = set(map(int,input().split(" "))) B = set(map(int,input().split(" "))) happiness = 0
for i in like_num: if i in A: happiness += 1 if i 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 →
this code passed all test cases, this approach did'nt use list comprehension. solution in python 3
` len_int = list(map(int,input().split(" "))) n , m = len_int[0], len_int[1]
like_num = list(map(int,input().split(" "))) A = set(map(int,input().split(" "))) B = set(map(int,input().split(" "))) happiness = 0
for i in like_num: if i in A: happiness += 1 if i in B: happiness -= 1
print(happiness)