mirror of
https://github.com/seigler/advent-of-code-browser-console
synced 2025-07-27 00:26:10 +00:00
multiple improvements, day 5 progress
This commit is contained in:
parent
c3433467d8
commit
53f2b9aec4
5 changed files with 7 additions and 4 deletions
3
2021/day03.js
Normal file
3
2021/day03.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
I=$('pre').innerText.trim().split`\n`;O=[];I.map(l=>[...l].map((x, i)=>{if(+x)O[i]=(O[i]||0)+1}))
|
||||
g=t=>parseInt(O.reduce((a,p)=>a+(t^(p<I.length/2)?0:1),""),2);
|
||||
[g(0)*g(1)]// just day 1 so far
|
Loading…
Add table
Add a link
Reference in a new issue