Painter's Partition Problem

https://hack.codingblocks.com/app/practice/1/1057/problem

My code is not passing 2 test cases.
code–> https://ide.codingblocks.com/s/646981

Please tell whats wrong.

@ujj1804_1156aee80205d0bf see i check your code i didnt find any mistake but i dont know why your code given 2 tc fail ur code is right bur still i give my implementation if u can check this and if possible compare

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.

Sir your implementation is showing wrong answer and if possible please try to find whats wrong in my code as only 2 test cases are not passing.

@ujj1804_1156aee80205d0bf aree its is right submitted all cases in my code i have given particular input thats why your code is similar to mine but still is not submit all cases

Yes sir your code passed all test cases , but my code is almost same as your code with same logic then why its not passing all cases ? Although the logic of the code is clear to me.

@ujj1804_1156aee80205d0bf thats what i am saying there is issue some time in hackersblocks but your code is right

Ok sir , thanks for telling.

@ujj1804_1156aee80205d0bf please rate
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.