only one test case is getting accepted though my code is correct
Rat chases its cheese
you need to make visited array so that you dont go through same path twice, and you have mixed up m and n in your code.
Corrected Code
only one test case is getting accepted though my code is correct
you need to make visited array so that you dont go through same path twice, and you have mixed up m and n in your code.
Corrected Code