aoc/2018/01/part1.js

12 lines
202 B
JavaScript
Raw Permalink Normal View History

2018-12-01 12:12:37 +00:00
const fs = require('fs');
let input = fs.readFileSync('input.txt', 'utf-8');
let freq = 0;
input.split('\n').forEach(line => {
num = parseInt(line);
if (num){
freq += num;
}
})
console.log(freq);