You are given an grid, representing a map with the following cell types:
'*': Your starting position. There is exactly
'#': A food cell. There may be multiple food cells.
'O': An empty cell that you can freely walk through.
'X': An obstacle that you cannot pass through.
You may move from a cell to any adjacent cell vertically or horizontally (up, down, left, or right) in grid and is not an obstacle.
Return the minimum number of steps required to reach any food cell from your starting position. If it is impossible to reach any food cell, return
Constraints:
m == grid.length
n == grid[i].length
grid[row][col] is '*', 'X', 'O', or '#'.
The grid contains exactly '*'.
You are given an grid, representing a map with the following cell types:
'*': Your starting position. There is exactly
'#': A food cell. There may be multiple food cells.
'O': An empty cell that you can freely walk through.
'X': An obstacle that you cannot pass through.
You may move from a cell to any adjacent cell vertically or horizontally (up, down, left, or right) in grid and is not an obstacle.
Return the minimum number of steps required to reach any food cell from your starting position. If it is impossible to reach any food cell, return
Constraints:
m == grid.length
n == grid[i].length
grid[row][col] is '*', 'X', 'O', or '#'.
The grid contains exactly '*'.