[LeetCode] 1926. Nearest Exit from Entrance in Maze
1926. Nearest Exit from Entrance in Maze Hardness: \(\color{orange}\textsf{Medium}\) Ralated Topics: Array、Breadth-First Search、Matrix 一、題目 You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze, where entrance = [entrancerow, entrancecol] denotes the row and column of the cell you are initially standing at. In one step, you can move one cell up, down, left, or right. You cannot step into a cell with a wall, and you cannot step outside the maze. Your goal is to find the nearest exit from the entrance. An exit is defined as an empty cell that is at the border of the maze. The entrance does not count as an exit. ...