We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 158239e commit 5f18178Copy full SHA for 5f18178
src/projecteuler/problem0018.ts
@@ -31,7 +31,8 @@ export function problem0018(_triangle: number[][]): number {
31
console.debug(`leafs count: ${leafs.length}`);
32
console.debug(`leafs: ${leafs}`);
33
34
- const max = leafs.reduce((a, b) => (a > b ? a : b));
+ const __START_FROM__ = 0;
35
+ const max = leafs.reduce((a, b) => (a > b ? a : b), __START_FROM__);
36
37
return max;
38
}
0 commit comments