Maximum triangle path sum: Difference between revisions
Content added Content deleted
m (→{{header|Python}}: (3.7) Tidying) |
|||
Line 2,154: | Line 2,154: | ||
''' |
''' |
||
return reduce( |
return reduce( |
||
lambda xs, ys: |
lambda xs, ys: [ |
||
a + max(b, c) for (a, b, c) in zip(ys, xs, xs[1:]) |
|||
], |
|||
)), |
|||
reversed(rows[:-1]), rows[-1] |
reversed(rows[:-1]), rows[-1] |
||
)[0] |
)[0] |