Please Login in order to post a comment
n, m = map(int, input().split(" "))
my_list = list(map(int, input().split(" ")))
set_a = set(map(int, input().split(" ")))
set_b = set(map(int, input().split(" ")))
happiness = 0
for i in my_list:
if i in set_a: happiness += 1 elif i in set_b: happiness -= 1 else: happiness
print(happiness)
Is the Explaination wrong??
No need to convert the values to int.
n, m = list(map(int, input().split())) ints = [int(i) for i in input().split()] A = set([int(i) for i in input().split()]) B = set([int(i) for i in input().split()]) happines = 0 for i in ints: if i in A: happines += 1 elif i in B: happines -= 1 print(happines)
n, m = map(int, input().split(" ")) lst = list(map(int,input().split(' '))) A = set(map(int,(input().split(' ')))) B = set(map(int,(input().split(' ')))) happiness = 0 for l in lst: if l in A: happiness +=1 elif l in B: happiness -=1 print(happiness)
Seems like cookies are disabled on this browser, please enable them to open this website
n, m = map(int, input().split(" "))
my_list = list(map(int, input().split(" ")))
set_a = set(map(int, input().split(" ")))
set_b = set(map(int, input().split(" ")))
happiness = 0
for i in my_list:
print(happiness)
Is the Explaination wrong??
No need to convert the values to int.