This commit is contained in:
Joshua Seigler 2020-12-16 16:55:13 +00:00
parent ba2a91c553
commit 8fae5d618d

1
day15.js Normal file
View file

@ -0,0 +1 @@
I=[9,12,1,4,17,0,18],F=a=>{L=new Map(I.slice(0,-1).map((a,b)=>[a,b]));let b=I[I.length-1];for(let c=I.length;c<a;c++)n=c-1-L.get(b)||0,L.set(b,c-1),b=n;return b},[F(2020),F(3e7)];