codingtests/solutions/ProjectEuler/018/desc.yml
2024-07-01 13:49:44 +00:00

25 lines
789 B
YAML

title: Find the maximum sum travelling from the top of the triangle to the base.
url: http://projecteuler.net/problem=18
desc: |
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below
(See file input)
solution: Instead of bruteforcing from top to bottom simply add the numbers from the bottom up and let the "highest" number win in a shootout
solutions:
solve.php:
desc: Basic solution
language: php
parameters: < ProjectEuler\018\input
solve.rb:
desc: Basic solution
language: ruby
parameters: < ProjectEuler\018\input