DSA Key Problems

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

Each cell in a direction grid points to one neighboring cell, and changing a cell's direction costs one. Return the minimum total change cost needed to create a directed path from the upper-left cell to the lower-right cell.