Remove unnecessary lines, for better test coverage

This commit is contained in:
2024-12-02 14:20:29 +01:00
parent e8b91bae4f
commit 7d694c4413
2 changed files with 2 additions and 10 deletions
-8
View File
@@ -4,10 +4,6 @@ export function solveFirst(input: string): number {
const regex = /^.*?(\d).*(\d).*?$|^.*(\d).*$/gm;
const match = input.matchAll(regex);
if (!match) {
return 0;
}
const numbers = Array.from(match, (m) =>
Number(m[3] ? `${m[3]}${m[3]}` : `${m[1]}${m[2]}`)
);
@@ -41,10 +37,6 @@ export function solveSecond(input: string): number {
/^.*?(one|two|three|four|five|six|seven|eight|nine|\d).*(one|two|three|four|five|six|seven|eight|nine|\d).*?$|^.*(one|two|three|four|five|six|seven|eight|nine|\d).*$/gm;
const match = input.matchAll(regex);
if (!match) {
return 0;
}
const numbers = Array.from(match, (m) =>
Number(
m[3] ? `${lookup[m[3]]}${lookup[m[3]]}` : `${lookup[m[1]]}${lookup[m[2]]}`
+2 -2
View File
@@ -74,8 +74,8 @@ export function solveFirst(input: string): number {
} while (edgeLength > 3);
if (process.env.NODE_ENV !== 'test') {
console.log(`That took ${i} tries`);
console.log(mult);
console.log(`That took ${i} tries, result: `, mult);
}
return mult;
}