RATE IN MAZE RECURSION

ONLY TEST CASE 4 IS NOT PASSING.PLS EXPLAIN WHY ??

Hello @rabimajumder08,

int sol[1000][1000] = {0};

Declare your above array globally just before the main function.

Declaring a large-sized array inside a function may lead to runtime errors because a function can’t allocate a huge amount of static memory.

all the test cases are passing except test case no 4… pls explain why

Hello @rabimajumder08,

Change your this portion of code,

cin.get();
for(int i=0;i<m;i++){
    for(int j=0;j<n;j++){
         char c=cin.get();
         maze[i][j]=c;
    }
    cin.get();
} 

Error:
cin.get() reads a string with the whitespace
So, in your character array, it’s taking newline also.
To avoid that, you need to add cin.get() again after each new line in input.

@rabimajumder08,

Is it clear now?

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.