Skip to content

Commit 7b077cf

Browse files
committed
feat: implement frequency calculation from input file
1 parent 9a34fb9 commit 7b077cf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require("fs");
2+
const lines = fs.readFileSync("input.txt", "utf8").split("\n");
3+
4+
let frequency = 0;
5+
6+
for (const line of lines) {
7+
if (line !== "") {
8+
frequency += Number(line);
9+
}
10+
}
11+
console.log(frequency);
12+

0 commit comments

Comments
 (0)