aoc/2015/05/part2.js
2018-12-10 23:56:11 +00:00

10 lines
228 B
JavaScript

const fs = require('fs');
const input = fs.readFileSync('input.txt', 'utf-8').split('\n');
let counter = 0;
for (let str of input) {
if (str.match(/(\w{2}).*\1/g) && str.match(/(\w)\w\1/g))
counter++;
}
console.log(counter)