You are given an `m x n` matrix `maze` (0-indexed) with empty cells `'.'` and walls `'+'`, and the `entrance` of the maze, where `entrance = [entrance_row, entrance_col]` is the cell you start in. In one step you can move up, down, left or right, but not into a wall or outside the maze. Find the nearest exit: an empty cell on the border of the maze. The entrance does not count as an exit. Return the number of steps on the shortest path from the entrance to the nearest exit, or `-1` if no such path exists.
You are given an m x n matrix maze (0-indexed) with empty cells '.' and walls '+', and the entrance of the maze, where entrance = [entrance_row, entrance_col] is the cell you start in. In one step you can move up, down, left or right, but not into a wall or outside the maze. Find the nearest exit: an empty cell on the border of the maze. The entrance does not count as an exit. Return the number of steps on the shortest path from the entrance to the nearest exit, or -1 if no such path exists.