Why is it giving wrong answer?

https://ide.codingblocks.com/s/360872 - here is the code.

Hey @shikhar07

		int l = 0;
		for (int i = 0; i < n; i++) {
			l=Math.max(l,pages[i]);
		}

please give a brief explanation about it

So the minimum pages u can allocate to one person will always be maximum of all the pages available ,so hence set low equal to it and then start

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.