Imagine you are an explorer lost in a maze. You can only move in four directions: up,
down, left, and right. Write a recursive function to help you find your way out of the
maze. The maze is represented as a 2D grid where ' 0 ' represents an open path and ' 1 '
represents a wall. Your function should return true if you can escape the maze, and
false otherwise.
Example:
Maze:
000
110
000
Expected Output: true|
Maze:
001
111
001
Expected Output: false
down. left. and right.Write a recursive function to help you find vour way out of the maze. The maze is represented as a 2D grid where'o'represents an open path and'1' represents a wall. Your function should return true if you can escape the maze, and false otherwise Example: Maze: 000 110 000
Expected Output: true
Maze: 001 111 001
Expected Output: false