This commit is contained in:
2024-12-06 10:26:09 +01:00
parent 49a3571c09
commit 6201805a0a
3 changed files with 37 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
import fs from "node:fs"
const input = fs.readFileSync("./2024/inputs/3").toString()
const result = Array.from(input.matchAll(/mul\((\d{1,3}),(\d{1,3})\)/g)).map(e => Number(e[1]) * Number(e[2])).reduce((acc, curr) => acc + curr)
console.log(result)