← ALL NOTES
Array

64. Minimum Path Sum

Swap "count the paths" for "minimize the cost" and the structure is identical: the cheapest way to reach (i, j) is grid[i][j] + min(cost from above, cost from left). The first row and column have…

Loading…