Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shahata committed Dec 25, 2024
1 parent 827710d commit 95662fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/2024/day14.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 95662fc

Please sign in to comment.