Montu Mia is a student of “Omok School”. He likes to eat an ice-cream every day. But he also likes t…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
notes = int(input())
note_list = input()
note_list = note_list.split()
note_list = [int(x) for x in note_list]
#ice-cream
items = int(input())
price_list = input()
price_list = price_list.split()
price_list = [int(x) for x in price_list]
count = 0
for i in price_list:
if i in note_list:
count +=1
if count>0:
print(1)
else:
print(0)
I have a question. In this problem, it is said that I must have exactly a note similar price to the ice-cream. I also have used this in my algorithm. But I am getting WA. Can anyone explain this more correctly?