Book allocation


this is my code its showing wrong answer upon submission

@Gautampriyadarshi, these are some errors:-

  1. take input of n and m inside while loop
  2. intialize sum with 0.
  3. check whether a[i] > min in your is possible function

corrected code: -

In case of any doubt feel free to ask :slight_smile:
Mark your doubt as resolved if you got the answer

Got it thank you very much

@O17LPOLA020023 can u please dry run on 4 student when 10 20 30 40 possible answer i m bit confused what to take when possible to read the books min value or curr ans to mid