Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a4673b0

Browse files
changes made
1 parent 436223f commit a4673b0

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

‎24- Dynamic Programming/minFallingPathSumTriangle.cpp‎

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@
22
// adjacent number of the row below.More formally, if you are on index i on the current row, you may move to either
33
// index i or index i + 1 on the next row.
44

5+
// Sample Inputs
6+
// 4
7+
// 2
8+
// 3 4
9+
// 6 5 7
10+
// 4 1 8 3
11+
// 1
12+
// -10
13+
14+
// Corresponding Outputs
15+
// 11
16+
// -10
17+
518
#include <bits/stdc++.h>
619
using namespace std;
720

21+
// recursive function
822
int minimumTotal(vector<vector<int>> &triangle)
923
{
1024
int n = triangle.size();
@@ -54,24 +68,3 @@ int main()
5468
}
5569
cout << minimumTotal(triangle);
5670
}
57-
58-
// Sample Inputs
59-
60-
// Sample Inputs
61-
62-
// Sample Inputs
63-
64-
// 4
65-
// 2
66-
// 3 4
67-
// 6 5 7
68-
// 4 1 8 3
69-
70-
// 1
71-
// -10
72-
73-
// Corresponding Outputs
74-
75-
// 11
76-
77-
// -10

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /