1-count problem

I’m getting a TLE , please check my code…

Your code must be running into an infinite loop.
Dry run and check with the sample test case.

I tried but I’m not able to identify the mistake, it looks fine to me.
Please help…

@prashantverma.vn
Sorry for the late response.
Check your code now

the 0th test case is giving wrong answer

@prashantverma.vn
Consider a test case:
1 0
0

Expected o/p:
0
0
Your Output:
0
1

Try to correct this.

1 Like

I made it correct…thanxx for the help…