No any test case is passing

Here it is not passing any test case…Although giving correct output for the local testcases…


Please check itt

at line no 40
sta=a[n-1]
start should be a[n-1]

But in video… sir has explained that we can take minimum as zero

Can you explain it… Because the bool function will take care of the minimum and maximum value

no if you take min then it will give wrong ans

you have to take start= max element which is a[n-1] last element

Can you show the test cases where it will give wrong answer

for the input
6 3
12 34 55 67 90 95

output should be 95
but your code show 82 as output

Can you explain this why this is happening… I am not able to get it

I think 82 will be correct answer…Because here we have to get tha maximum number of pages assigned to student should be minimum, and 82 is less tahn 95

but if you consider 82 then your are not able to read all pages in book
95 pages cann’t be read in any way

that is why we have to set min no of pages = max element of array

to correct this just do one change s=a[n-1]

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like :heart:: and don’t forgot to mark doubt as resolved :grinning: