Piyush and magical park

check why code not working not for given test case

I have edited your code… Try to submit now…