aoc/2015/5/part2.js
2018-12-09 17:40:24 +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)