sir, in the code why we are initializing the start with the maximum of s and books[i].
you explained it very well in the dry run but you always take the start from the 0. but in code you are starting with 40. why??
Got stuck in the code
Hello @mayank01000,
This is done to reduce the number of iterations and thus to reduce the time complexity.
This decision of initializing s with maximum number of pages is made based on the observation:
at least one student will be assigned that book having maximum number of pages.
Hope, this would help.
Give a like if you are satisfied.