From 6336bec39b73b661ffb73a74ce0d30fb8eedf618 Mon Sep 17 00:00:00 2001 From: Alix von Schirp Date: Tue, 11 Nov 2025 06:54:42 +0100 Subject: [PATCH] 2015/3: fix red lines (assert arrays) --- src/2015/3/1/index.ts | 4 ++-- src/2015/3/2/index.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/2015/3/1/index.ts b/src/2015/3/1/index.ts index 7a1bdd3..cb455a2 100644 --- a/src/2015/3/1/index.ts +++ b/src/2015/3/1/index.ts @@ -28,8 +28,8 @@ export default async function runner(inputPath: string) { break; } if(!map[x]) map[x] = []; - if(map[x][y]) continue; - map[x][y] = true; + if(map[x]![y]) continue; + map[x]![y] = true; houses++; diff --git a/src/2015/3/2/index.ts b/src/2015/3/2/index.ts index ebc085b..c3ac7e4 100644 --- a/src/2015/3/2/index.ts +++ b/src/2015/3/2/index.ts @@ -35,10 +35,10 @@ export default async function runner(inputPath: string) { default: break; } if(!map[x]) map[x] = []; - if(map[x][y]) { + if(map[x]![y]) { continue; } - map[x][y] = true; + map[x]![y] = true; houses++; } else { @@ -58,10 +58,10 @@ export default async function runner(inputPath: string) { default: break; } if(!map[roboX]) map[roboX] = []; - if(map[roboX][roboY]) { + if(map[roboX]![roboY]) { continue; } - map[roboX][roboY] = true; + map[roboX]![roboY] = true; houses++; }