From 95662fc29303d47b64bd30d392e68fc36a038bd1 Mon Sep 17 00:00:00 2001 From: Shahar Talmi Date: Wed, 25 Dec 2024 07:58:18 +0200 Subject: [PATCH] bug fix --- src/2024/day14.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2024/day14.js b/src/2024/day14.js index 393dc022..be75c339 100644 --- a/src/2024/day14.js +++ b/src/2024/day14.js @@ -70,7 +70,7 @@ export function part2(input, w = 101, h = 103) { map[robot.py][robot.px] = "#"; }); let match = 0; - for (let y = 0; y < h - tree.length; y++) { + for (let y = 0; y < h; y++) { if (map[y].join("").includes(tree[match])) { match++; if (match === tree.length) return i;