1293. Shortest Path in a Grid with Obstacles Elimination
Description
**Input:**
grid =
[[0,0,0],
[1,1,0],
[0,0,0],
[0,1,1],
[0,0,0]],
k = 1
**Output:** 6
**Explanation:**The shortest path without eliminating any obstacle is 10.
The shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> **(3,2)** -> (4,2).**Input:**
grid =
[[0,1,1],
[1,1,1],
[1,0,0]],
k = 1
**Output:** -1
**Explanation:**We need to eliminate at least two obstacles to find such a walk.ac
Previous1292. Maximum Side Length of a Square with Sum Less than or Equal to ThresholdNext1294. Weather Type in Each Country
Last updated