Piyush and magical park

sir what is the mistake in this code

@qudsiya i have removed the compilation errors (single inverted commas)


but your code gives wrong for sample test case (dry run it)
also you can refer prateek bhaiya video on this question-


dont forget to hit like and mark resolved if cleared :smiley:

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.