Can you tell me an approach to solve this question by using linked list. I am able to solve it using backtracking in 2 d array.
Rat chases its cheese
@shivanshmittal25 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.
why is it that when i am submitting this code in backtracking section question its is giving me 100 points but in linked list section its showing incorrect output for first 2 cases giving me 60 points.
@shivanshmittal25 Read the problem statement properly."The rat can move from a position towards left, right, up or down on the grid. " It is not the same rat in a maze problem in the backtracking section where the possible movement was only in the right and downward direction. Here you have to consider all 4 directions.