You are given an maze with '.' and walls denoted by '+'. You are also provided an array entrance = entrance_row, entrance_col
From any cell, you can move to an adjacent empty cell in one of the four cardinal directions: up, down, left, or right. You cannot enter a cell containing a wall, and you cannot walk outside the boundaries of the grid.
An exit is defined as any empty cell located on the border of maze that is not the entrance itself.
Return the minimum number of steps required to travel from entrance to the closest exit. If no path to an exit exists, return
Constraints:
maze.length m
maze[i].length n
m, n
maze[i][j] is either '.' or '+'
entrance.length
entrance_row m
entrance_col n
entrance will always be an empty cell
You are given an maze with '.' and walls denoted by '+'. You are also provided an array entrance = entrance_row, entrance_col
From any cell, you can move to an adjacent empty cell in one of the four cardinal directions: up, down, left, or right. You cannot enter a cell containing a wall, and you cannot walk outside the boundaries of the grid.
An exit is defined as any empty cell located on the border of maze that is not the entrance itself.
Return the minimum number of steps required to travel from entrance to the closest exit. If no path to an exit exists, return
Constraints:
maze.length m
maze[i].length n
m, n
maze[i][j] is either '.' or '+'
entrance.length
entrance_row m
entrance_col n
entrance will always be an empty cell