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 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”.

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;
}

a = int(input())
b = input()
c = int(input())
d = input()
b = set(b.split())
d = set(d.split())
e = b.intersection(d)
e = list(e)
e = len(e)
print(e)

Why WA in case?