4 lines
286 B
JavaScript
4 lines
286 B
JavaScript
var input = require("fs").readFileSync("input.txt").toString().replace(/\r/g, "");
|
|
var triangles = input.split("\n").map((a)=>(a.split(" ").filter((b)=>(b)).map((b)=>(parseInt(b))))).filter(([a, b, c])=>(((a + b) > c) && ((b + c) > a) && ((a + c) > b)));
|
|
console.log(triangles.length);
|