Please tell me the flow of return or what is the work after returning true or false
#include
using namespace std;
bool RatinMaze(char maze[][100],int soln[][100],int m,int n,int i,int j){
// base case
if(i==m && j==n){
soln[m][n]=1;
// prints
for(int i=0;i<=m;i++){
for(int j=0;j<=n;j++){
cout<<soln[i][j]<<" ";
}cout<<endl;
}cout<<endl;
return true;
}
// recursive case
if(i>m or j>n){
return false;
}
if(maze[i][j]==‘X’){
return false;
}
soln[i][j]=1;
bool right=RatinMaze(maze,soln,m,n,i,j+1);
if(right)
return true;
bool down=RatinMaze(maze,soln,m,n,i+1,j);
if(down){
return true;
}
soln[i][j]=0;
return false;
}
int main() {
int m,n;cin>>m>>n;
char maze[100][100];int soln[100][100];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cin>>maze[i][j];
}
}
bool ans=RatinMaze(maze,soln,m-1,n-1,0,0);
if(!ans){
cout<<"-1";
}
}