C++ simple and easy to understand solution
\n### Code\ncpp []\n\nclass Solution {\npublic:\n    bool findSafeWalk(vector<vector<int>>& grid, int health) {\n        int m = grid.size();\n        int n = g
\n### Code\n```cpp []\n\nclass Solution {\npublic:\n    bool findSafeWalk(vector<vector<int>>& grid, int health) {\n        int m = grid.size();\n        int n = grid[0].size();\n\n        // Directions for moving in the grid (right, down, left, up)\n        vector<vector<int>> visited(m, vector<int>(n, -1));\n        queue<pair<pair<int, int>, int>> q;\n\n        q.push({{0, 0}, health - grid[0][0]});\n        visited[0][0] = health - grid[0][0];\n        int direction[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};\n\n        while (!q.empty()) {\n            auto [pos, currhealth] = q.front();\n            q.pop();\n\n            int x = pos.first;\n            int y = pos.second;\n\n            if (x == m - 1 && y == n - 1 && currhealth > 0)\n                return true;\n            for (int i = 0; i < 4; i++) {\n\n                int newx = x + direction[i][0];\n                int newy = y + direction[i][1];\n\n                if (newx >= 0 && newy >= 0 && newy < n && newx < m) {\n                    int newhealth = currhealth - grid[newx][newy];\n\n                    if(newhealth>0 &&newhealth>visited[newx][newy])\n                    {\n                        visited[newx][newy]=newhealth;\n                        q.push({{newx,newy},newhealth});\n                    }\n                }\n            }\n        }\n        return false;\n    }\n};\n```
['C++']