Please help me find the error in the code

my code

i have done some changes

  1. correct base case
    if(i==m-1 && j==n-1) {

  2. this line should be added
    if(rs==true)return true;

you can check the modified code

Modified Code

if any modification you didn’t understand
feel free to ask