diff --git a/2021/day01.js b/2021/day01.js index e3cd570..07d4c94 100644 --- a/2021/day01.js +++ b/2021/day01.js @@ -1 +1 @@ -d=$('pre').innerText.trim().split`\n`;t=(d,n)=>d.reduce((a,x,i)=>a+(+x>d[i-n]),0);[t(d,1),t(d,3)] \ No newline at end of file +d=$('pre').innerText.trim().split`\n`;[1,3].map(n=>d.reduce((a,x,i)=>a+(+x>d[i-n]),0)) \ No newline at end of file