My code is here it is failing two test cases
Test case 2 and Test Case 3
Painter Problem
ok. i will wait. i want to tell also that i had tried some test cases which i have seen from other coding blocks discussion it is working for them
hello @hrithik-1 i have corrected your code and now it is passing every test case.
the check function of yours was not correctly defined and your range should start from the max element in the array.
if you have any doubt you can ask here:
Happy Learning !!
Thank You Sir , but can you tell me if possible where i went wrong because the check function has a very slight change like explaining the logic where you corrected and i went wrong
see you have to check in the check function if the the curren board is not greater then the mid then you will increment the board to that painter only but if the same is not true then you will try to ask another painter to help for the same.
at any point we feel that we need more painter then we have to return false but you were doing this outside the loop.
and you have to decide you range, you were doing that as in wrong way.
i have explained that above.
Happy Learning !!
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.