[LeetCode] 3286. Find a Safe Walk Through a Grid (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명You are given an m x n binary matrix grid and an integer health. You start on the upper-left corner (0, 0) and would like to get to the lower-right corner (m - 1, n - 1). You can move up, down, left, or right from one cell to another adjacent cell as long as your health remains positive. Cells (i, j) with grid[i][j] = 1 are considered unsafe and reduce your health by 1. Return t..