Skip to content

Commit

Permalink
get day 09 under 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
merrywhether committed Dec 9, 2024
1 parent d2b946c commit aecfe6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/07/main.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit aecfe6b

Please sign in to comment.