Book allocation-test case is failing

hey @ankityadav943, you should take s=a[n-1]. Also there are some more changes in your code that I have indicated as comments. https://ide.codingblocks.com/s/107892

why are you putting s=a[n-1]. the search space should start from 0. so s should be equal to 0.??

hey @ankityadav943, we need to minimize the maximum number of pages. Minimum answer will be last book beacause last book has maximum number of pages(given in question) and will be assigned to someone.

but sir i had solved same question on gfg where s=0

Hello There,
https://ide.codingblocks.com/s/347071 I just solved this problem using this solution, do let me know if you’ve some optimization in this code:)