I was stupid!
This commit is contained in:
parent
77d1850bb6
commit
f3b98d74bd
@ -1,4 +1,4 @@
|
|||||||
var input = require("fs").readFileSync("input.txt").toString();
|
var input = require("fs").readFileSync("input.txt").toString();
|
||||||
var rows = input.split("\n").filter((a)=>(a)).map((a)=>(a.split("\t").map((b)=>(parseInt(b)))));
|
var rows = input.split("\n").filter((a)=>(a)).map((a)=>(a.split("\t").map((b)=>(parseInt(b)))));
|
||||||
var divis = rows.map((a)=>(a.map((b)=>(a.map((c)=>(b/c)).filter((c)=>(c%1 == 0)).filter((c)=>(c!=1))[0])).filter((c)=>(c))));
|
var divis = rows.map((a)=>(a.map((b)=>(a.map((c)=>(b/c)).filter((c)=>(c%1 == 0)).filter((c)=>(c!=1))[0])).filter((c)=>(c)))[0]);
|
||||||
console.log(divis.reduce((a, b)=>(a + parseInt(b))));
|
console.log(divis.reduce((a, b)=>(a + b)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user