mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-21 14:08:11 +01:00
Solve day 1 part 1
This commit is contained in:
parent
cd02ef3595
commit
8307409c2c
1 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)).reduce((prev, current) => {if (prev < current) {total += 1} return current});
|
||||
console.log(total);
|
||||
|
Loading…
Reference in a new issue