Problem
You are starving and you want to eat food as quickly as possible. You want to find the shortest path to arrive at any food cell. You are given anm x n character matrix, grid, of these different types of cells:
'*'is your location. There is exactly one'*'cell.'#'is a food cell. There may be multiple food cells.'O'is free space, and you can travel through these cells.'X'is an obstacle, and you cannot travel through these cells.
-1.
Examples
Constraints
m == grid.lengthn == grid[i].length1 <= m, n <= 200grid[row][col]is'*','X','O', or'#'.- The
gridcontains exactly one'*'.