Skip to content

Instantly share code, notes, and snippets.

@ghaiklor
Last active January 5, 2016 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghaiklor/967e768b00abb2a1680b to your computer and use it in GitHub Desktop.
Save ghaiklor/967e768b00abb2a1680b to your computer and use it in GitHub Desktop.
Advent of Code (Day 12 Part 1)
const fs = require('fs');
const INPUT = fs.readFileSync('./input.txt', 'utf-8');
const NUMBER_REGEX = /-?\d+/g;
const result = INPUT.match(NUMBER_REGEX).reduce((total, number) => total + +number, 0);
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment