Algorithm · LinkedIn · Medium
You are placed at the top‑left cell of an m x n grid. Some cells are impassable walls; every other cell charges a step cost when you first move onto it. Moves are allowed in the four cardinal directions. Stepping from cell A to an adjacent cell B costs exactly the step cost written in B. The starting cell has no cost associated with it, and arriving on the target cell is free. The grid is given as an integer matrix where -1 denotes a wall (cannot enter), 0 marks the unique…
Checking your access…