const fs = require('fs'); const data = fs.readFileSync('test.txt', 'utf-8'); const groups = data.split('\n\n'); let sum = 0 for (let g = 0; g char == group[i])) { chars.push(group[i]) } } // keep a sum for our puzzle answer sum += chars.length } console.log(sum)