COVIDTEST GETING ( WA) EVEN AFTER RIGHT ANSWER HELP ME I AM NEW HERE

see i fixed the code still getting WA

https://www.codechef.com/viewsolution/31977340

no bro its giving me right answer see CodeChef: Practical coding for everyone

No its not, now your code is giving wrong answer for the second test-cases which is given in the problem i.e.

1
7
1 0 0 0 0 0 1

Your Code Output:

NO

Correct Answer:

YES

Read the problem statement carefully just by making your code work for a particular case doesn’t mean, your solution is correct that just a vague way saying your solution is correct.
Generate test-cases (5-10) on your own and check whether your program is giving the right answer or not.
I already told you the rough idea about how to build the solution.

NOTE: Write easy to understand code, your code is messy, at-least when you are asking in a forum, comment your code explaining about what you have done, choose self-describable variable names and then ask for help.
Why? Because no one has that much time to refactor your code and then start finding out bugs/mistakes and after the process finds out that there is a very non-sense bug in the code which you could have also found out.

If you are new to the forum read the following posts before making a post again:

  1. How To Create Minimum Reproducible Code Example.
  2. Code Formatting Guidelines.

hey bro still you are looking in my old code …i fixed all the issues in my previus code just look in that code …but still getting same WA error…

https://www.codechef.com/viewsolution/31977340

Listen I am looking at your current code only, try running your code on multiple test-cases from the command line directly on the test cases which I talked about earlier, your code is still giving the wrong answer because there is a very subtle bug in your program because of which you are getting WA, debug it you will find it.

3
7
1 1 0 1 0 0 0
7
1 1 0 1 0 0 1
7
1 0 0 0 0 0 1

Your Code Output:

NO
NO
NO

Correct Output:

NO
NO
YES

ya i got it bro… thank you brother … now its accepted … thank you a lot for your kind respond and help