Concept Flow - Rat in a Maze Problem
Start at (0,0)
Check if current cell is safe
Yes
Mark cell as part of path
Move Right
→Move Down
If path found
No
Backtrack: Unmark cell
Return False if no moves possible
Goal reached at (N-1,N-1)
Return True - path found
The rat starts at the top-left cell and tries to move right or down if the cell is safe. It marks the path and backtracks if stuck, until it reaches the goal.