Skip to content

Instantly share code, notes, and snippets.

@emplv
Last active December 5, 2019 07:50
Show Gist options
  • Select an option

  • Save emplv/b87499b5f754961da659bc6d5928e51d to your computer and use it in GitHub Desktop.

Select an option

Save emplv/b87499b5f754961da659bc6d5928e51d to your computer and use it in GitHub Desktop.
AoC 2019 - day 1
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