You are given an N*M grid. Each cell (i,j) in the grid is either blocked, or empty. The rat can move from a position towards left, right, up or down on the grid.
Initially rat is on the position (1,1). It wants to reach position (N,M) where it’s cheese is waiting for. There exits a unique path in the grid . Find that path and help the rat reach its cheese.
How to use linked list in this problem pls provide logic
@divyamsaxena123 This is a problem related to backtracking. It is best solved using recursion and backtracking. The problem is given in the linked list section but actually it is a backtracking problem. There is no such approach using Linked List.
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.