Algorithm Flow
Step 0 of 1
Loading visualization...
Pseudocode
1FUNCTION minimumTotal(triangle) 2 FOR row ← triangle.length - 2 DOWNTO 0 DO 3 FOR col ← 0; col < LENGTH(triangle[row]); col++ DO 4 minBelow ← MIN(triangle[row + 1][col], triangle[row + 1][col + 1]) 5 triangle[row][col] ← triangle[row][col] + minBelow 6 END FOR 7 END FOR 8 RETURN triangle[0][0] 9END FUNCTIONTest Cases
Step 0 of 1
Input
(empty)
Expected
(empty)
Execution Trace
| Step | Action | Variables |
|---|---|---|
| 1 | START: minimumTotal | - |