Please help me in chef and sequence
This is my attempt at solving “Chef and his Sequence”, a beginner level question.Once again,i am getting the right output but the judge is giving me a “Wrong Answer”.Please help me find why this is happening.

This question is actually unclear.

What you actually have to do is, IRRESPECTIVE OF ORDER, just find if elements of his favorite sequence are present in given array or not.

1 Like

OH!.Thank you so much.

I am utterly confused.
I changed my code according to what you said and am getting the correct outputs but the judge is giving me a “Wrong Answer”.HELP PLEASE!

Okay, let me have a look then :slight_smile:

You are overcounting here. Take this test case-

1 2 3 2 5
1 2 3

Here, what you are doing is to count ‘2’ twice getting a value of 4 in k. Try changing that and see if things work out or not :slight_smile:

OH YES.I swapped the i and j in my loops.I got a “Correct Answer”.HAHA THANK YOU.You are a boss.

@kriskhundu If the answer helped, please marked it as a right solution