Rat chases its cheese

I am unable to think how this question can be done using linked list. Please give me a hint to approach this problem.

hi kajal
it is do be done by backtracking not link list
i think it is by mistaken given in the link list section