diff options
author | Julien Dessaux | 2022-12-28 20:03:29 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-12-28 20:04:09 +0100 |
commit | 3430a7074b85b12bb16d9906c04e857448e85f44 (patch) | |
tree | 7c0a2db727eadfef707b4a0715866bb9f40d52a9 /2022/18-Boiling-Boulders | |
parent | 2022-18 in js (diff) | |
download | advent-of-code-3430a7074b85b12bb16d9906c04e857448e85f44.tar.gz advent-of-code-3430a7074b85b12bb16d9906c04e857448e85f44.tar.bz2 advent-of-code-3430a7074b85b12bb16d9906c04e857448e85f44.zip |
2022-19 in js
Diffstat (limited to '2022/18-Boiling-Boulders')
-rw-r--r-- | 2022/18-Boiling-Boulders/second.js | 4 |
1 files changed, 2 insertions, 2 deletions
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); |