mirror of
https://github.com/seigler/advent-of-code-browser-console
synced 2025-07-26 00:06:10 +00:00
Day 17
This commit is contained in:
parent
ae2b23fbcf
commit
b75c87af88
1 changed files with 1 additions and 0 deletions
1
2021/day17.js
Normal file
1
2021/day17.js
Normal file
|
@ -0,0 +1 @@
|
|||
[a,b,c,d]=$('pre').innerText.match(/-?\d+/g).map(x=>+x),B=M=C=0;for(V=c;V<=-c;V++)for(W=1;W<=b;W++,M>B?B=M:0)for(x=y=M=0,X=W,Y=V;y>M?M=y:0,x<=b&&y>=c||(M=0);x+=X,y+=Y,X-=Math.sign(X),Y--)if(!(x<a||x>b||y<c||y>d)&&++C)break;[B,C]
|
Loading…
Add table
Add a link
Reference in a new issue