Solve day 1 part 1

This commit is contained in:
Gabriel Augendre 2021-12-02 19:59:48 +01:00
parent cd02ef3595
commit 8307409c2c

4
2021/day01.js Normal file
View file

@ -0,0 +1,4 @@
let total = 0;
$("pre").innerText.trim().split("\n").map(el => Number(el)).reduce((prev, current) => {if (prev < current) {total += 1} return current});
console.log(total);