What is error in my code?

I was solving the All ones problem in DP section.

My program is giving wrong answers for half of the test cases. Plz help me find out the error in my code.

Here’s the link to my code: https://ide.codingblocks.com/s/328116

Hey @siddharth_1_3277 you have missed some of special cases and for that i have edited your code. You can have a look at here : https://ide.codingblocks.com/s/328144
Hope it will help you understanding problem better

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.