Maximum triangle path sum: Difference between revisions
Content added Content deleted
m (→{{header|Java}}: small changes) |
m (→{{header|Ruby}}: Compatibility with Ruby < 1.9) |
||
Line 659:
until ar.size == 1 do
maxes = ar.pop.each_cons(2).map(&:max)
ar[-1]= ar[-1].zip(maxes).
end
puts ar # => 1320</lang>
|