Ice-Cream of Montu Mia Again!

Montu Mia is a student of “Omok School”. He likes to eat an ice-cream every day. But he also likes to buy that ice-cream with his daily pocket money. His father always gives him maximum pocket money for the purpose of transportation costs only. Because his mother makes tiffin for him every day.


This is a companion discussion topic for the original entry at https://toph.co/p/ice-cream-of-montu-mia-again

what is the problem??

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?

2 posts were split to a new topic: Strikedthrough Toph Handles

my 4th output is wrong. but what is the problem?

#include<stdio.h>
int main(){
int arr1[100],arr2[100],n,m,i,j;
scanf("%d", &n);
int count = 0;
for(i=0;i<=n-1;i++){

    scanf("%d", &arr1[i]);

}
scanf("%d", &m);

for(j=0;j<=m-1;j++){

    scanf("%d", &arr2[j]);

}
for(i=0;i<=n-1;i++){
    for(j=0;j<=m-1;j++){
        if(arr1[i]==arr2[j]){
            count = count + 1; }

    }

}

printf("%d", count);

return 0;
}