From 3430a7074b85b12bb16d9906c04e857448e85f44 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 28 Dec 2022 20:03:29 +0100 Subject: 2022-19 in js --- 2022/18-Boiling-Boulders/second.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '2022/18-Boiling-Boulders') diff --git a/2022/18-Boiling-Boulders/second.js b/2022/18-Boiling-Boulders/second.js index a1f57a7..18101ee 100644 --- a/2022/18-Boiling-Boulders/second.js +++ b/2022/18-Boiling-Boulders/second.js @@ -28,7 +28,7 @@ function solve(input) { let [x, y, z] = line.split(",").map(n => parseInt(n)); min = Math.min(min, x, y, z); max = Math.max(max, x, y, z); - }) + }); min -=1; max +=1; // start with an edge and fill up the space @@ -40,7 +40,7 @@ function solve(input) { const eltstr = elt.join(","); const [x, y, z] = elt; if (x < min || x > max || y < min || y > max || z < min || z > max) continue; - if (visited.has(eltstr)) continue + if (visited.has(eltstr)) continue; if (input.includes(eltstr)) continue; visited.add(eltstr); count += countSides(x, y, z, input); -- cgit v1.2.3