I tried this question on hackerblocks but some testcases failed

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

my code : https://ide.codingblocks.com/s/601649

please help me identifying what’s wrong with my approach

Hi… u have done unnecessary things in can_paint function… refer to my soln https://ide.codingblocks.com/s/601740

i hope ur doubt is cleared now???

thank you my doubt is already cleared but i have doubts in some other places please try to resolve them

did get what u are meant by doubts in other places??
shall i mark(painters partition ques) this doubt as resolved??

yes you can mark it as resolved
and I was talking about the other doubts that i posted from Dynamic Programing

maybe some one else has picked up ur doubts… u raise a new doubt… i will take it

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.