64 Minimum Path Sum
Last updated
Was this helpful?
Last updated
Was this helpful?
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.
Note:You can only move either down or right at any point in time.
Example 1:
Given the above grid map, return7
. Because the path 1→3→1→1→1 minimizes the sum.
(1) DP
时间复杂度O(mn), 空间复杂度O(mn)