aoc01

by schmidjon

JavaScript

const solvePuzzle =
	(input) => input
  	.split("\n")
		.reduce(
      (accumulator, currentValue) =>
        parseInt(accumulator) + parseInt(
          currentValue.match(/^[a-z]*([0-9])/)[1]
          + currentValue.match(/([0-9])[a-z]*$/)[1]
        )
      , 0
   ...