Rat chases its cheese

sir whats the error in it

@vikashkmr519,
I have corrected your code:

Errors:

  1. You cannot take char input in Java. You need to take string for every line and then assign the chars.
  2. int path[][] = new int[n][n]; instead of int path[][] = new int[n][m]; This was giving Run Time error since array was going out of bound

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.