I'm trying to solve this problem on euler:
Large sum
Problem 13
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 ... 53503534226472524250874054075591789781264330331690
I'm trying to concat all the lines into one big chunk of line, however I'm not getting the expected result, can anyone see what I did wrong here?
var fs = require("fs");
var total = "\n";
let m1 = fs.readFileSync('lines.txt').toString().split('\n').forEach(line => {
total += line;
})
console.log(total)
output:
53503534226472524250874054075591789781264330331690
Process finished with exit code 0