please share the code of brute force solutions?
Book allocations problems
I am providing you an approach where you can just use for loop from i=s and i<=e. And increment by 1 each time instead of binary search
For the test case Student
4 Books and 2 students
10,20,30,40
Ans will be 60.
First will read the first 3 books while the second will read the last book.
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.
@amankumarkeshu can u please tell me what if the when u have 4 student in above example. I bit confused what our end goal is like student should read maximum books but the no of pages or sum should be minimal right.
so if we have 10 20 30 40 and our student is 4 then what should our expected answer? 10 40
And also this is not the brute force one is optimized solutions