Suppose there is no restriction as cell marked with X , means we can move to extreme right from first cell or extreme down from first cell and we need to print paths in the form of alphabets . What changes to above code has to be done if keeping above both points ?
Doubt regarding a problem similar to this?
@ritik_99 hey for path printing just print the visited array in base case ,so for every time a path is found it print path and if there is no restriction so just remove the condition of restriction which you applied in previous question,rest code will almost be same and it will be more easier than previous.
And any change in base cases? Like if it can move to last column then it can only move down and if in same column in th last row it can only move right which was not the case in this rat in a maze question ? Does this needs to be Included in the base case or without that also it will consider that case ?
@ritik_99 yes base case will change accordingly as in our previous case we were also adding condition if there is obstacle then we return from that ,so here eliminate that condition,also boundary checking condition in base case remain same such that index dont get out of boundary.
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.