mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-05 22:33:59 +01:00
4 lines
238 B
JavaScript
4 lines
238 B
JavaScript
let total = 0;
|
|
$("pre").innerText.trim().split("\n").map(el => Number(el)).map((el, index, array) => el + array[index+1] + array[index+2]).reduce((prev, current) => {if (prev < current) {total += 1} return current});
|
|
console.log(total);
|
|
|