JavaScript BFS explained
Simple enough BFS solution using the current coordinates and health points (HP), commented for clarity.  Since the bounds are not that big, we can do a simple B
Simple enough BFS solution using the current coordinates and health points (HP), commented for clarity.  Since the bounds are not that big, we can do a simple BFS to search through all the cells.  \n\nWe keep track of which cells we visited, and what our HP was at that point.  If we visit a cell that we\'ve previously visited with equal or better HP then we can skip it, but if we reach the visited cell with better HP via a different path then we should continue to search from there using our improved HP.\n\nThe BFS time and space complexity is based on the `m x n` grid size.\n\nTime complexity: O(m * n)\nSpace complexity: O(m * n)\n\n```\n/**\n * @param {number[][]} grid\n * @param {number} health\n * @return {boolean}\n */\nvar findSafeWalk = function(grid, health) {\n    \n    // Set[`${x},${y}`] = best previously seen HP value at cell [x,y]\n\t// Keep track of cells we already visited and don\'t need to search\n    const seen = new Set();\n    \n    // Get our BFS ready.  We will queue up cells using [x, y, hp value]\n    let start = [0,0,health];\n    const queue = [start];\n    \n    while(queue.length > 0){\n\t\n        let node = queue.shift();        \n\t\t\n        // Get the current cell coordinates and current HP \n        let [x,y,health] = node;\n        \n        // Update our current health using current grid cell value\n        health -= grid[x][y];\n                \n        // If dead at the current cell, continue/skip to next node in queue\n        if(health <= 0){\n            continue;\n        }\n        \n        // If not dead after visiting current sell and also at the finish point, return true\n        if(x === grid.length - 1 && y === grid[0].length - 1){\n            return true;\n        }\n        \n        // Check if we\'ve already visited this cell at an equal or better HP value\n\t\t\t// If we\'ve already visited this cell with equal or greater HP value, continue\n\t\t\t// Else we mark current cell as visited with our current HP value\n        let coord = `${x},${y}`\n        if(seen[coord] >= health){\n            continue;\n        }else{\n            seen[coord] = health;\n        }\n        \n        // Get neighboring cells and add to BFS queue with our current HP value \n        const neighbors = getValidNeighbors(x,y);\n\t\t\n        for(const child of neighbors){\n            const [x,y] = child;\n            queue.push([x,y,health]);\n        }\n    }\n    \n    // If we exhausted the BFS queue and didn\'t reach the end with positive HP, can finally return false\n    return false;\n    \n    \n    // A small helper function to get the neighboring cells within grid bounds\n    function getValidNeighbors(x,y){\n        \n        let coords = [];\n        \n        // vectors to move up, down, left, and right\n        const offsets = [\n            [-1,0],\n            [1,0],\n            [0,-1],\n            [0,1]\n        ]\n        \n        for(const offset of offsets){\n            // Use our vectors to get the neighboring coordinates\n            x1 = x + offset[0];\n            y1 = y + offset[1];\n            \n            // If both the X and Y coordinate are within bounds, we can add it to the helper function output \n            if(x1 >= 0 && y1 >= 0 && x1 < grid.length && y1 < grid[0].length){\n                coords.push([x1,y1]);\n            }\n        }\n        \n        return coords;\n    }\n};\n```
['Breadth-First Search', 'Ordered Set', 'JavaScript']