Please take a look my coding is not passing test cases

Hello @anshulgurawalia this is the corrected code:


Happy Learning!!

can you tell me the mistake in my code
i got my 1 mistake that i am checking the reading pages greater then mid after adding the next pages of the book i have to check first if less then mid then add to the reading pages .
but my code is still not passing the test cases can you tell me why ???

@anshulgurawalia you have to take range in which you will start from the largest book size in the array.
secondly when you got your answer then update ans=mid;
third you have to take data type as long long int.
i have shared the corrected code above you can see that.

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.