64. Minimum Path Sum
problem description
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.
Note: You can only move either down or right at any point in time.
Example:
algorithm thought
和上一题没什么不同,动态规划换汤不换药。上一题是路线的数量,这里是找到最小值。
code
algorithm analysis
时间复杂度和上两题一样,O(n²)
Last updated