diff --git a/2023/01/index.ts b/2023/01/index.ts index 93e8bc3..d166035 100644 --- a/2023/01/index.ts +++ b/2023/01/index.ts @@ -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]]}` diff --git a/2023/25/index.ts b/2023/25/index.ts index ed989b9..df28407 100644 --- a/2023/25/index.ts +++ b/2023/25/index.ts @@ -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; }