Given a triangle of integers represented as a list of rows, find the minimum path sum from the top to the bottom.
r
and index
c
, you may move to row
r+1
at index
c
or
c+1
.
triangle
: a list of lists of integers, where
triangle[i]
has length
i+1
.
1 <= number of rows <= 200
Triangle:
[2]
[3, 4]
[6, 5, 7]
[4, 1, 8, 3]
Minimum path sum is 2 + 3 + 5 + 1 = 11.