i have tried this problem but getting wrong answer in some test cases. can u tell me how to modify it to pass all the test cases ?
Test cases not passed in piyush and magical park problem
made updates in the code
u werent
checking for the corner cases at the correct position
check this code