This is My solution.
I simply used binary search, searched for the value, if the value is more or equal than the needed books, set low = mid, else set high = mid. Then I returned low. However, the solution was wrong, I tried to debug it many time but no AC.
Can you tell me why the code is wrong or I’m just missing a few corner cases.