Painter's Partition Problem

Can you help me with the algorithm to solve this problem ?
i have tried the code, but it is not completed yet… Help me with this.

@ankita_10
Sure I will help you out
Please send your code

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.