mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
Project Euler : add solution for problem 18 (Max Path Sum I) + test.
This commit is contained in:
18
Project-Euler/test/Problem018.test.js
Normal file
18
Project-Euler/test/Problem018.test.js
Normal 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)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user