最小路径和

LeetCode 经典 150 多维动态规划
难度: 中等

题目描述

找到二维网格中从左上到右下的路径中最小的路径和。

解题思路

使用动态规划,递推公式为 dp[i][j] = grid[i][j] + min(dp[i-1][j], dp[i][j-1])。