4 lines
241 B
JavaScript
4 lines
241 B
JavaScript
var input = require("fs").readFileSync("input.txt").toString().replace("\n", "");
|
|
var chars = input.split("").map((a)=>(parseInt(a)));
|
|
console.log(chars.filter((a, i)=>(chars[(i+(chars.length/2))%chars.length] == a)).reduce((a, b)=>(a+b)));
|