fix lint rules and small readme improve

This commit is contained in:
2023-12-06 21:05:52 +01:00
parent fa1bb19623
commit 2f35776696
12 changed files with 73 additions and 63 deletions

View File

@@ -14,12 +14,10 @@ function extractDigits(line: string): number[] {
const digitsFound: number[] = [];
let i = 0;
while (i < line.length) {
let matched = false;
for (const [word, digit] of Object.entries(digitMap)) {
if (line.startsWith(word, i)) {
digitsFound.push(digit);
i += word.length - 1;
matched = true;
break;
}
}