This commit is contained in:
Zynh0722 2023-12-03 21:38:06 -08:00
commit 7cb042c0ba
3 changed files with 28 additions and 0 deletions

3
one/.prettierrc Normal file
View file

@ -0,0 +1,3 @@
{
"arrowParens": "avoid"
}

13
one/one.js Normal file
View file

@ -0,0 +1,13 @@
import fs from "node:fs";
let data = fs.readFileSync("input", "utf8");
let lines = data
.split("\n")
.map(l => l.split("").filter(c => +c == c))
.map(l => [l[0], l[l.length - 1]])
.map(l => l.join(""))
.map(n => Number(n))
.reduce((acc, n) => acc + n);
console.log(lines);

12
one/package.json Normal file
View file

@ -0,0 +1,12 @@
{
"name": "one",
"version": "1.0.0",
"description": "",
"main": "one.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"type": "module"
}