美文网首页
64. Minimum Path Sum

64. Minimum Path Sum

作者: 我是你的果果呀 | 来源:发表于2016-12-23 08:55 被阅读0次

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.

第一种方法m*n 空间复杂度 

第二种方法 m空间复杂度

DP formula  dp[i+1] = min(dp[i+1], dp[i]) +value[i][j];

相关文章

网友评论

      本文标题:64. Minimum Path Sum

      本文链接:https://www.haomeiwen.com/subject/naycvttx.html