Triangle
The problem is to find the minimum path sum from top to bottom if given a triangle. Each step you may move to adjacent numbers on the row below.
Input
triangle
: see example
Output
the minimum path sum
Examples
Example 1:
Input:
triangle = [ [2], [3,4], [6,5,7], [4,1,8,3] ]
Output: 11
Explanation:
The minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11
.