Last active
December 5, 2019 07:50
-
-
Save emplv/b87499b5f754961da659bc6d5928e51d to your computer and use it in GitHub Desktop.
AoC 2019 - day 1
This file contains hidden or 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
| const INPUT = ` | |
| COPY & PASTE HERE | |
| `.trim().split`\n`; | |
| // part 1 | |
| INPUT.map(x=>t+=(i=x/3-2|0)>0?i:0,t=0)|t; | |
| // part 2 | |
| INPUT.map(f=i=>(i=i/3-2|0)>0?f(i,t+=i):0,t=0)|t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment