If we take test case as 4 books with 10,20,30,40 book sizes. And 2 students then it is possible that student 1 reads books with 10 and 40 pages and student 2 reads books with 20 and 30 pages and so maximum number of pages any student has to read is 50. But algorithm given in question says answer is 60.
Solution for book allocation
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.
Thanks for replying. How should we solve the problem if this constraint wasn’t there ie if student need not read only consecutive books.