Created
December 15, 2023 10:41
-
-
Save lwhjp/32b6513f4accb3cc3d1264858b8ee1b7 to your computer and use it in GitHub Desktop.
AoC 2023 day 09 (part 1) in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a=(...x)=>e(x[1])?eval("a("+b(x,...x)):x[0],b=(_,...x)=>e(x[1] | |
)?x[1]+`- ${x[0]},`+b(...x): `)+`+x[0],c=x=>"eval('"+"^+a(/\n)/ ," | |
.split(/\//).reduce((x,y)=>x.replaceAll(RegExp(y[0],"mg"),y.slice( | |
1)),x.trim()+")')"),d=x=> eval(c(f.readFileSync(x).toString())),e= | |
x=>x!=undefined,f=require('node:fs');console.log(d("input09.txt")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment