what does it mean that there exists a unique path
Doubt related to Question
See for this test case, x is the box on which you can’t traverse, and you can traverse only on circles. While moving up, down, left & right. By doing so you will get a unique path, which is drawn by blue line on grid and expressed by 1 below the grid. You have to print that path.
Yellow is starting point
Red is ending point.
Does that mean i have to find the answer ehre i have moved in all 4 direction?
Yes… And all you have to keep in mind , is that you don’t come out of grid while traversing
Can you tell me why this approach not working
Check now =>
can you explain the changes
You forgot to check whether the left right down up indexes of sol is 0 or not, also there wasn’t a true statement. So just have added few statements to be sure solution exist. Now add that case when no solution exist. If return of this function is false. Then print what’s given in the question. I guess the will solve your query.
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.
