Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. You can only move either down or right at any point in time.
(最小带权路径和,只能向右或者向下移动从左上角移动到右下角的带权路径和)
Example:
1. 动态规划
在前两道题目的基础上,类似于求一个带权路径和的问题。具体实现过程如下:
1 | class Solution: |