mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-25 07:58:11 +01:00
Merge branch 'master' of git.sr.ht:~crocmagnon/advent-of-code
This commit is contained in:
commit
2393ce0618
2 changed files with 4 additions and 0 deletions
4
2021/day01.js
Normal file
4
2021/day01.js
Normal 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
BIN
2021/day02.ods
Normal file
Binary file not shown.
Loading…
Reference in a new issue