4 lines
331 B
JavaScript
4 lines
331 B
JavaScript
var input = require("fs").readFileSync("input.txt").toString();
|
|
var lines = input.split("\n").filter((a)=>(a)).map((line)=>(line.split(" ").map((a)=>(line.split(" ").filter((b)=>(b.split("").sort().join("") == a.split("").sort().join(""))).length == 1)).reduce((a, b)=>(a && b),true))).filter((a)=>(a));
|
|
console.log(lines.length);
|