Test Cases Failing

Sir, I tried coding the solution of painter’s problem but only the test case 0 is passing and the rest of the test cases are failing.
Here is my solution: https://ide.codingblocks.com/s/649402

Hello @singhkaranpreet710_f5e2ca6a9e8e0721,

I have updated the code,
Updated Code

Sir, @PUNEET_GOEL why these two lines of code are required- ans = ans*T;
ans %= 10000003;

@singhkaranpreet710_f5e2ca6a9e8e0721,

  1. In the problem statement, it is mentioned Return the ans % 10000003,
  2. Instead of binary searching over the time required, I binary searched over minimum length and then calculated ans = (min_length)*(Time per unit)

Thank you so much @PUNEET_GOEL sir for clearing my doubt.

1 Like

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.