1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/最小路径和 [minimum-path-sum].html
2022-03-29 12:43:11 +08:00

32 lines
983 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给定一个包含非负整数的 <code><em>m</em> x <em>n</em></code> 网格 <code>grid</code> ,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。</p>
<p><strong>说明:</strong>每次只能向下或者向右移动一步。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/11/05/minpath.jpg" style="width: 242px; height: 242px;" />
<pre>
<strong>输入:</strong>grid = [[1,3,1],[1,5,1],[4,2,1]]
<strong>输出:</strong>7
<strong>解释:</strong>因为路径 1→3→1→1→1 的总和最小。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>grid = [[1,2,3],[4,5,6]]
<strong>输出:</strong>12
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>m == grid.length</code></li>
<li><code>n == grid[i].length</code></li>
<li><code>1 <= m, n <= 200</code></li>
<li><code>0 <= grid[i][j] <= 100</code></li>
</ul>