Wrong answer

I often get wrong answers and its very difficult to find the mistake in my logic. This is very demotivating, Please help me to find the error in the code and give some suggestions which would help me to find the errors myself.

This is my submission
https://www.codechef.com/viewsolution/82416977

I still have doubt in this, I would be grateful if someone clarifies it!

Here’s the question

And here’s my submission
https://www.codechef.com/viewsolution/82416977

I just want to find a mistake in my code and if possible, some tips for finding test cases in which my code fails

Hi Yaswanth - fyi - your code currently fails on this test case.

Thanks for the help :smiley:
I’ll try to fix the error.