You are viewing a single comment's thread. Return to all comments →
Works absolutely fine without converting the input to integer.
happiness = 0 ints = input() array = input().split() A = set(input().split()) B = set(input().split()) for i in array: if i in A: happiness += 1 elif i in B: happiness -= 1 print(happiness)
Converting the input to integer as the task was for ints and for any future test case update.
happiness = 0 ints = input() array = list(map(int, input().split())) A = set(map(int, input().split())) B = set(map(int, input().split())) for i in array: if i in A: happiness += 1 elif 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 →
Works absolutely fine without converting the input to integer.
Converting the input to integer as the task was for ints and for any future test case update.