We can solve this problem using backtracking?

But don’t know how to solve it using linked list

Hello @sharad1103

This question is related to backtracking only.
Why are you trying to solve it using linked list.
and what part does the linked list play in your approach.

What you should do is just input the N*M grid in a matrix and use backtracking.

this question has been asked in link list section

Hello @sharad1103

It would have been wrongly added in the linked list section.
This question is from backtracking only.