one big repo for all years

This commit is contained in:
Joshua Seigler 2021-12-02 15:52:52 -05:00
parent 4e1cd98bf1
commit ccc3cdba3a
9 changed files with 0 additions and 0 deletions

1
2020/day02.js Normal file
View file

@ -0,0 +1 @@
let d=document.body.textContent.trim().split('\n').map(l=>l.match(/(.+)-(.+) (.): (.+)$/));[d.reduce((s,[_,l,u,n,h])=>{const c=[...h.matchAll(RegExp(n,'g'))].length;return c<=u&&c>=l?s+1:s},0),d.reduce((s,[_,a,b,n,h])=>{return h[a-1]==n^h[b-1]==n?s+1:s},0)];