Painter problem


all the testcases are showing wrong answer.pls tell the correct code

inside the is_answer function the following lines of code:
// if(sum){
// no_of_painters++;
// if(no_of_painters>k)
// return false;
// }

ALSO the no of painter should be 1 at the start.
Because there has to minimum 1 painter working.
are not required.
Because the case returns false only when the no of required painters become max allowable painter.

Refer the below code
in case of discripancy

The answer for sample input is coming 5 instead of 50.

see there are 2 diff problem available on CB, one is painter problem other is painter partition problem,

for the code u have provided :
the i/p are in form of
Painter’s Partition Problem
and it passes the test cases

but u have put in refernce the painter problem…

Just a little adaptation needs to be made, by adding t in i/p and multiplying it and taking mod with 10000003

tell me which one are u solving of the 2 q

ur code suggests Painter’s Partition Problem

This suggests the other one