Skip to content

Commit 5467d65

Browse files
committed
Implement final frequency calculation
1 parent 7fd5ba8 commit 5467d65

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const fs = require("fs");
2+
3+
const raw = fs.readFileSync("input.txt", "utf8");
4+
5+
const lines = raw.split("\n");
6+
const numbers = lines.map(Number);
7+
function findFinalFrequency(nums) {
8+
let total = 0;
9+
10+
for (const n of nums) {
11+
total += n;
12+
}
13+
14+
return total;
15+
}
16+
console.log(findFinalFrequency(numbers));

0 commit comments

Comments
 (0)