I am totally confuse in the conditions inside while loop

let say pages of books are:{ 10,20,30,40}
then lb=40;
and ub=100;
if students are able to read the book having 70 pages so its obivious that they also read the 50,60 pages so why we
changing ub=mid-1;

Hello @anshulgurawalia which while loop you are talking about?

@anshulgurawalia read this line carefully:
The task is to assign books in such a way that the maximum number of pages assigned to a student is minimum.
we have to find the order so that we can assign the books to the students but we have to find least maximum answer possible.
that is why we wil try to decrease our range.

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.