Rat in a maze question


How to print a single path only?

Maintain a visited path array and before traversing to any of the direction, check if that path is already visited or not.