Objective
In a triangle of numbers you go from the top to the base and at each step you move to one of the two adjacent numbers in the row below. Computing from the bottom up, each square adds the better of its two children.
Instructions
- The first line has the number
nof rows; thennlines: rowihasinumbers. - Show
Maximum sum: xwith the largest possible sum of a path from the top to the base.
4
3
7 4
2 4 6
8 5 9 3
Maximum sum: 23
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise