unable to make a logic for the question, Please help.
Book allocation Problems
@Yuvraj_Luhach
Please refer the lecture video on book allocation video. It is there in your playlist. It is very well explained there.
Anyways
In this problem, we have to minimize the maximum number of pages each student has to read.
Note that whenever there are such optimization problem where you have to maximize/minimize and the span of final answers form a monotonic function, Binary Search approach can be applied.
Consider sample case: where there are 4 books and 2 student
Pages in each book: 10 20 30 40 Here answer is 60.(1 student allotted 10+20+30 pages and other 40 pages)
Here the span of answers will be from 0 to 10+20+30+40=100 as a student can read a maximum of 100 pages.You answer will lie in this span and you have to optimize it. We say that the span of answers form a monotonic function because answer<60 is not possible(for which isValid function will return false) and answer>60 is always possible(for which isValid function will return true).Least among all true values(ie.60) is the answer for which we apply binary search.
Refer the explaniation video on book allocation problem once or twice and you will get it.