Concept Flow - Rat in a Maze Problem
Start at (0,0)
Check if current cell is safe
Yes
Mark cell as path
Move Right
→Move Down
If move leads to solution
Yes→Return True
No
Backtrack: Unmark cell
Return False if no moves work
End: Solution found or no path
The rat starts at the top-left cell and tries to move in four directions if the cell is safe. It marks the path and backtracks if stuck, until it finds the exit or exhausts all options.
