diff --git a/2021/day01.js b/2021/day01.js new file mode 100644 index 0000000..09d7737 --- /dev/null +++ b/2021/day01.js @@ -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); + diff --git a/2021/day02.ods b/2021/day02.ods new file mode 100644 index 0000000..8709859 Binary files /dev/null and b/2021/day02.ods differ