advent-of-code-browser-console/day05.js
Joshua Seigler e353642348 day 5
2020-12-05 01:03:09 -05:00

2 lines
No EOL
204 B
JavaScript

let d=document.body.textContent.replaceAll(/[FL]/g,0).replaceAll(/[BR]/g,1).trim().split`
`.map(c=>parseInt(c.slice(0,7),2)*8+parseInt(c.slice(7),2)).sort((a,b)=>b-a);[d[0],d.find((s,i,S)=>s-S[i+1]==2)-1]