triangle has i + 1 numbers in row i. Start at the top and move down; from position j of a row you may go to position j or j + 1 of the next row. Return the smallest sum of a path from the top to the bottom. An empty triangle gives 0.
For [[2], [3, 4], [6, 5, 7], [4, 1, 8, 3]] the answer is 11 (2 + 3 + 5 + 1).
Example 1
Input:
minimum_total([[2], [3, 4], [6, 5, 7], [4, 1, 8, 3]])
Output:
11
Example 2
Input:
minimum_total([[-10]])
Output:
-10
0 <= rows <= 1000-10**4 <= value <= 10**4No results yet
Run your code to check it against the examples, or submit to run every test.