From f3c4b5b7d51c3d32f8040c7f06356770158353a5 Mon Sep 17 00:00:00 2001 From: Pascal Syma Date: Wed, 25 Dec 2024 11:42:01 +0100 Subject: [PATCH] Cleanup 2024-25 --- 2024/25/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/2024/25/index.ts b/2024/25/index.ts index 01bccc6..3934abe 100644 --- a/2024/25/index.ts +++ b/2024/25/index.ts @@ -14,18 +14,16 @@ export function solveFirst(input: string): number { (combinations, b) => { const rows = b.split('\n'); const isLock = b[0][0] === '#' ? 1 : 0; - const comb: KeyLock = []; + const combination: KeyLock = []; for (let i = 0; i < rows[0].length; i++) { const column = rows.flatMap((r) => r[i]); - comb.push(column.filter((c) => c === '#').length - 1); + combination.push(column.filter((c) => c === '#').length - 1); } - combinations[isLock].push(comb); + combinations[isLock].push(combination); return combinations; }, [[], []] as [KeyLock[], KeyLock[]] ); - // const locks = blocks.filter((b) => b[0][0] === '#'); - // const key = blocks.filter((b) => b[0][0] === '.'); const found = locks.map((l) => sumBy(keys, (k) => (checkKeyLock(l, k) ? 1 : 0))