This commit is contained in:
2020-12-06 12:00:47 +00:00
parent 5557eb57e2
commit d97cf9f03a
3 changed files with 2200 additions and 0 deletions

6
06/part1.js Normal file
View File

@@ -0,0 +1,6 @@
const fs = require('fs');
fs.readFile('input', (err, data) => {
if (err) throw err;
let groups = data.toString().split("\n\n").map( (group) => new Set( group.replace(/\r?\n|\r/g, "").split('') ) );
console.log(groups.reduce((sum, group) => sum + group.size, 0));
});