Unable to impose bottom up condition

https://ide.codingblocks.com/s/350643 how to impose the condition on bottom up dp that if i am unable to add the stones of all color then i should return INT_MIN??

hello @Shobhit_kumar

image

here u can add one more condition.
dp[i-1][j-y]!=INT_MIN

sir i have also added a doubt in square painting problem but that hasn’t been addressed yet…plz help on that

@Shobhit_kumar

no live request is there .
image

some other TA is taking ur doubt, wait for his/her response

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.