Search
⌘K

Leetcode 1368. Minimum Cost to Make at Least One Valid Path in a Grid

Given a grid where each cell points to a neighbor and flipping a cell's arrow costs 1, find the minimum number of flips needed to create any path from the top-left to the bottom-right. This is a shortest-path problem on a directed grid where moves that follow a cell's arrow cost 0 and other moves cost 1 (solvable with 0-1 BFS or Dijkstra).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.