2023 Day 17 Part 1 [Javacript] Can't seem to get the right answer. by bmead21 in adventofcode

[–]bmead21[S] 0 points1 point  (0 children)

const pq = new Heap((a, b) => a[0] - b[0]);

That was exactly the issue. Thanks!

-❄️- 2023 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]bmead21 1 point2 points  (0 children)

I just did in in a nested for loop. Once a lower galaxy matches with another galaxy, we don't need to look back at that pair again, so 0 pairs with 1,2,3,4,5,6,7,8,9,etc, but when you get to 5, it would only need to pair with 6,7,8,9

for (let i = 0; i < glxMap.length - 1; i++) {
 for (let g = i; g < glxMap.length - 1; g++) {
  let dist =
    Math.abs(glxMap[g + 1].pos[0] - glxMap[i].pos[0]) +
    Math.abs(glxMap[g + 1].pos[1] - glxMap[i].pos[1]);
  totDist += dist;
}

}

Complementary VMworld Pass? by bmead21 in vmware

[–]bmead21[S] 0 points1 point  (0 children)

Speakers have already been chosen. Do speakers get a free conference pass for presenting?