Project Euler : add solution for problem 18 (Max Path Sum I) + test.

This commit is contained in:
Eric Lavault
2021-10-13 11:36:22 +02:00
parent 5f601fac8d
commit 98ee73447e
2 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { maxPathSum } from '../Problem018'
const example = `
3
7 4
2 4 6
8 5 9 3
`
describe('Check Problem 18 - Maximum path sum I', () => {
it('Check example', () => {
expect(maxPathSum(triangle)).toBe(23)
})
it('Check solution', () => {
expect(maxPathSum()).toBe(1074)
})
})