Merge branch 'master' of git.sr.ht:~crocmagnon/advent-of-code

This commit is contained in:
Gabriel Augendre 2021-12-02 20:21:42 +01:00
commit 2393ce0618
2 changed files with 4 additions and 0 deletions

4
2021/day01.js Normal file
View file

@ -0,0 +1,4 @@
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);

BIN
2021/day02.ods Normal file

Binary file not shown.