[Python 3] BFS - Clean, simple easy to understand
\ndef nearestExit(self, maze: List[List[str]], entrance: List[int]) -> int:\n\tm, n = len(maze), len(maze[0])\n\tq = deque([(entrance[0], entrance[1])])\n\tstep
```\ndef nearestExit(self, maze: List[List[str]], entrance: List[int]) -> int:\n\tm, n = len(maze), len(maze[0])\n\tq = deque([(entrance[0], entrance[1])])\n\tsteps = 0\n\twhile q:\n\t\tl = len(q)\n\t\tfor _ in range(l):\n\t\t\tr, c = q.popleft()\n\t\t\tif r < 0 or r == m or c < 0 or c == n or maze[r][c] == \'+\':\n\t\t\t\tcontinue\n\t\t\tif (r == m - 1 or c == n - 1 or r == 0 or c == 0) and steps:\n\t\t\t\treturn steps\n\t\t\tmaze[r][c] = \'+\'\n\t\t\tq.extend([(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)])\n\t\tsteps += 1\n\treturn -1\n```
['Breadth-First Search', 'Python', 'Python3']