Painter's partition problem

Isn’t this problem like book allocation problem,
I want to ask that can I arrange the given boards in ascending order first and then solve the question.
Will it be a correct approach??

As you can see the constraints of the problem are that a painter can only paint contiguous boards. for eg. a painter can paint board no(1,2,3) but he can’t paint board no. (2,4,5) because its not contiguous. so the order of board given in input matters a lot. it means you can not reorder the boards and solve it.
Hint: Think about optimal substructure.
Thanks

please resolve it and rate it if satisfied.
Thanks…

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.