hey, guys please help me as I am not able to pass all the test cases. here, you can find the coding implementation for that problem.
Painter Problem
@Deepak388
You are not counting the time factor while checking isPossible . While taking the sum in isPossible , you should multiple each board[ i ] with t to account for time taken for each board. Also , the end point for your search space will not be total sum of board[ i ] but rather sum of board[ i ] * t . Consider the case when only one painter has to paint all the boards , then your search space does not include the correct answer. Also , rather than returning st , make an ans variable and modify its value in your if condition.
ans = m;
Return this answer value instead of st as that it likely to give your wrong answers.
Finally , use long long int for your variables as your answer will exceed the range of int for sure.
@Deepak388
As per the problem statement , you have to take modulo with 10000003 since your answer can get very large. Make this change.