Simple and Easy C++ code
IntuitionWe iterate through every cell in the grid and find the suitable path.ApproachTo solve this problem, we can use a breadth-first search (BFS) approach to
# Intuition
We iterate through every cell in the grid and find the suitable path.

# Approach
To solve this problem, we can use a breadth-first search (BFS) approach to simulate the traversal of the grid. The key is to ensure that at every step, the health remains positive, and we only proceed to a neighboring cell if it does not violate this condition. We'll also need to track the current health at each position to avoid revisiting the same cell with less health.

# Complexity
- Time complexity:
O(m*n)

- Space complexity:
O(m*n)

# Code
```cpp []
class Solution {
public:
    bool findSafeWalk(vector<vector<int>>& grid, int health) {
        
        int m = grid.size(), n = grid[0].size();
    vector<vector<int>> directions = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
    vector<vector<int>> visited(m, vector<int>(n, -1));
    queue<tuple<int, int, int>> q;
    q.push({0, 0, health - grid[0][0]});
    visited[0][0] = health - grid[0][0];

    while (!q.empty()) {
        auto [x, y, curHealth] = q.front();
        q.pop();

        if (curHealth <= 0) continue;
        if (x == m - 1 && y == n - 1) return true;

        for (auto& dir : directions) {
            int nx = x + dir[0], ny = y + dir[1];
            if (nx >= 0 && ny >= 0 && nx < m && ny < n) {
                int nextHealth = curHealth - grid[nx][ny];
                if (nextHealth > visited[nx][ny]) {
                    visited[nx][ny] = nextHealth;
                    q.push({nx, ny, nextHealth});
                }
            }
        }
    }
    return false;
    }
};
```
['C++']