By starting at the top 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 in numTriangle
, a 2D array containing a triangle with one-hundred rows.
Information at Project Euler 067
Getting Started
Select Show Solution to show the solution. Select Hide Solution to hide the solution. You can also view the triangle in array form as a PDF File.
User Stories
As a user, I can show or hide the solution by selecting the appropriate button.
As a user, I can view the PDF File of the triangle in array form.
As a user, I expect the function maximumPathSumII(numTriangle)
to return a number.
As a user, I expect the function maximumPathSumII(numTriangle)
to return 7273.
User Stories on function maximumPathSumII(numTriangle)
taken from FreeCodeCamp - Coding Interview Prep - Project Euler 067
Information Architecture
The function maximumPathSumII(triangle)
returns a number, where triangle is a 2D Array.
A PDF File containing the triangle array is supplied.
Allows the user to show or hide the solution to the problem as described in Project Euler 067. A PDF file of the triangle in array form can also be viewed.
Uses HTML5, CSS3, JavaScript, Bootstrap 5.2.3 and Google Fonts.
Ensure all user stories have been met.
Deployed on GitHub Pages at the main branch.
Array in script.js
and triangle.pdf
taken from FreeCodeCamp.