Book Allocation Problem

wrong answer but working for the sample input

Plz send your code by saving on ide so that I could check it.

I have edited your code madhur, your both functions were correct, only there were very little changes that need to be made, try to submit the code now,