This commit is contained in:
2025-11-11 06:53:21 +01:00
parent b1653348a2
commit 0b24a5828e
2 changed files with 35 additions and 0 deletions

16
src/2015/8/1/index.ts Normal file
View File

@@ -0,0 +1,16 @@
export default async function runner(inputPath:string){
const input = await Bun.file(inputPath).text();
let diff = 0;
input.split("\n").forEach(line => {
if(line.trim() === '') return;
const cLength = line.trim().length;
// DO NOT DO THIS!!!!!! THIS IS UNSAFE!!!!!!
const eLength = eval(`${line.trim()}.length`);
const ecDiff = cLength-eLength;
diff += ecDiff;
})
console.log(diff)
}

19
src/2015/8/2/index.ts Normal file
View File

@@ -0,0 +1,19 @@
export default async function runner(inputPath:string){
const input = await Bun.file(inputPath).text();
let diff = 0;
input.split("\n").forEach(line => {
if(line.trim() === '') return;
const eLength = line.trim().length;
const cLine = `"${line.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}"`;
const cLength = cLine.length;
const ecDiff = cLength-eLength;
diff += ecDiff;
})
console.log(diff)
}