diff --git a/deno.json b/deno.json index 9f8c718..c2cc0aa 100644 --- a/deno.json +++ b/deno.json @@ -5,6 +5,7 @@ "input": "deno run -NEWR src/crypto.ts --get=$DAY", "solve": "deno run -R src/$DAY/main.ts", "test": "deno test -R src/**/test.ts", + "test:all": "deno test -R src/**/*test.ts", "test:input": "deno test -R src/**/input.test.ts" }, "imports": { diff --git a/src/07/main.ts b/src/07/main.ts index 3460278..fed7a62 100644 --- a/src/07/main.ts +++ b/src/07/main.ts @@ -1,8 +1,8 @@ // { calibrationSum: 4998764814652, concatCalibrationSum: 37598910447546 } -// Elapsed: 207ms +// Elapsed: 94ms function concatNumbers(a: number, b: number) { - return Number(`${a}${b}`); + return a * Math.pow(10, Math.ceil(Math.log10(b + 1))) + b; } function numbersProduceTestValue(