Leetcode 3596. Minimum Cost Path with Alternating Directions I
Given a grid with movement costs, find the minimum total cost to go from a start to a target cell while your moves must alternate between horizontal and vertical directions; treat the last move direction as part of state and use graph search / DP (BFS or Dijkstra) over (row, col, last-direction) to compute the optimal path.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.