Shortest Path in a Grid with Obstacles Elimination
You are given an `m x n` integer matrix `grid` where each cell is `0` (empty) or `1` (obstacle). In one step you can move up, down, left or right to an empty cell. Return the minimum number of steps to walk from the upper left corner `(0, 0)` to the lower right corner `(m - 1, n - 1)` given that you can eliminate at most `k` obstacles. If no such walk exists, return `-1`.
30:00
Shortest Path in a Grid with Obstacles Elimination
You are given an m x n integer matrix grid where each cell is 0 (empty) or 1 (obstacle). In one step you can move up, down, left or right to an empty cell. Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at most k obstacles. If no such walk exists, return -1.