Roti prata code check


please tell the mistake in the code.It is showing wrong answer on spoj but running correctly on cb ide

it seems there is some problem with the canCook function

go through this once

I got this one but cannot find the mistake in my logic:(

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.