mirror of
https://github.com/seigler/advent-of-code-browser-console
synced 2025-07-27 00:26:10 +00:00
one big repo for all years
This commit is contained in:
parent
4e1cd98bf1
commit
ccc3cdba3a
9 changed files with 0 additions and 0 deletions
1
2020/day02.js
Normal file
1
2020/day02.js
Normal 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)];
|
Loading…
Add table
Add a link
Reference in a new issue