Problem 1885. Minimum Sum thru a Lower Triangle
This Challenge is to find the minimum cumulative sum that traverses from row-1 thru row-N via vertical/diagonal adjacent elements of adjacent rows.
The input is a series of values of length n*(n+1)/2.
Input: S [Series that can be converted into a lower triangle]
Output: MinSum [Minimum cost path from top to bottom]
Example:
[5 7 6 3 2 5] becomes
5 0 0 7 6 0 3 2 5
Creates a MinSum of 13 [5+6+2]. The 5 can only see 6, 3 sees 7 and 6, while 2 sees 7 6 0.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3037 Solvers
-
How to find the position of an element in a vector without using the find function
2777 Solvers
-
The Hitchhiker's Guide to MATLAB
3364 Solvers
-
225 Solvers
-
Backslang, odds are you used it at some point in time...
77 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!