Skip to content

Commit c2fb6ce

Browse files
committed
Create README - LeetHub
1 parent 13896e5 commit c2fb6ce

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h2><a href="https://leetcode.com/problems/minimum-falling-path-sum/">931. Minimum Falling Path Sum</a></h2><h3>Medium</h3><hr><div><p>Given an <code>n x n</code> array of integers <code>matrix</code>, return <em>the <strong>minimum sum</strong> of any <strong>falling path</strong> through</em> <code>matrix</code>.</p>
2+
3+
<p>A <strong>falling path</strong> starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position <code>(row, col)</code> will be <code>(row + 1, col - 1)</code>, <code>(row + 1, col)</code>, or <code>(row + 1, col + 1)</code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/03/failing1-grid.jpg" style="width: 499px; height: 500px;">
8+
<pre><strong>Input:</strong> matrix = [[2,1,3],[6,5,4],[7,8,9]]
9+
<strong>Output:</strong> 13
10+
<strong>Explanation:</strong> There are two falling paths with a minimum sum as shown.
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/03/failing2-grid.jpg" style="width: 164px; height: 365px;">
15+
<pre><strong>Input:</strong> matrix = [[-19,57],[-40,-5]]
16+
<strong>Output:</strong> -59
17+
<strong>Explanation:</strong> The falling path with a minimum sum is shown.
18+
</pre>
19+
20+
<p>&nbsp;</p>
21+
<p><strong>Constraints:</strong></p>
22+
23+
<ul>
24+
<li><code>n == matrix.length == matrix[i].length</code></li>
25+
<li><code>1 &lt;= n &lt;= 100</code></li>
26+
<li><code>-100 &lt;= matrix[i][j] &lt;= 100</code></li>
27+
</ul>
28+
</div>

0 commit comments

Comments
 (0)