Triangle
Given a triangle array, return the minimum path sum from top to bottom. For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.
Triangle

Given a triangle array, return the minimum path sum from top to bottom. For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.

Example 1:
Input: [[2],[3,4],[6,5,7],[4,1,8,3]]
Output: 11
Input
arr =[[2],[3,4],[6,5,7],[4,1,8,3]]

Initialize DP with triangle values

Input Triangle

2

3

4

6

5

7

4

1

8

3

DP (Min Path Sum)

2

3

4

6

5

7

4

1

8

3

Minimum Path Sum: 0

Current

Computed

Minimum

Variables
No variables to display
DepthFunction Call
Stack empty
0/10