How to do this question

how to do this question using linked list???

@Adhyayan rat chases its cheese is a backtracking question, how are you coming up with linkedlist bro?

I know it’s a backtracking question but it was given in linked list challenges that why I asked to clarify, thank-you