Book allocation problem

if (arr[i] > curr_min)
return false;

without this condition the ans comes wrong !!!

why coz if we dont do this then also number of students will overshoot then also we will recieve false only

hello @hg11110000 this condition is necessaru because without this condition it will try to allocate that as well.
even if it is greater then that.

@tusharaggarwal272

or if we do other way i m not getting why we take max of the pages as the lower limit and sum of all srray as the max limit @tusharaggarwal272

if you have number of students equal to the number of pages or the size if the array then you can minimize you answer and for that you the minimum time taken will be by the student to whom the book with the maximum pages is allocated .
and we have taken the sum if only one student is there then we dont have any option except to allocate all pages to him only .

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.