Book allocation problem

please tell what is the error in my code

this is the link to ide

@sushreesamapika41
number of books are m, so start should be arr[m-1];
just change line no 39 to int start=arr[m-1];
your code will work

@sushreesamapika41
As I can see you got 100 points. Please mark this doubt as resolved.

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.