Simple BFS Solution
Code\npython3 []\nclass Solution:\n    def findSafeWalk(self, grid: List[List[int]], health: int) -> bool:\n        # aux[i][j] is the max health you can have b
# Code\n```python3 []\nclass Solution:\n    def findSafeWalk(self, grid: List[List[int]], health: int) -> bool:\n        # aux[i][j] is the max health you can have by reaching there.\n        # go to a place only if the resultant health is > what exists\n        m, n = len(grid), len(grid[0])\n        q = deque([[0, 0, health-grid[0][0]]])\n        aux = [[-inf] * n for _ in range(m)]\n        aux[0][0] = health-grid[0][0]\n        if aux[0][0] <= 0: return False\n        dirs = [[1,0],[-1,0],[0,1],[0,-1]]\n        while q:\n            x, y, rem_health = q.popleft()\n            if x == m-1 and y == n-1:\n                return True\n            if aux[x][y] > rem_health:\n                continue\n            for dx, dy in dirs:\n                tx , ty = x+dx, y+dy\n                if 0 <= tx < m and 0 <= ty < n:\n                    if aux[tx][ty] < rem_health-grid[tx][ty] and rem_health > grid[tx][ty]:\n                        aux[tx][ty] = rem_health - grid[tx][ty]\n                        q.append([tx, ty, rem_health-grid[tx][ty]])\n        return False\n```
['Breadth-First Search', 'Matrix', 'Shortest Path', 'Python3']