Advent of Code Revisited: Day 18-25

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 8

  • @deraileddash
    @deraileddash Год назад

    These review videos are amazing. I've learned so much from them. You deserve a medal!

  • @addictedyounoob3164
    @addictedyounoob3164 Год назад +1

    Thanks for taking the time to make and explain all of this.

  • @DannyBres
    @DannyBres Год назад

    Thanks for this video really enjoyed the deep dive on each puzzle and the algorithms that back them. What font do you use in VSCode btw, I like the way == and

  • @n3zlnluka5
    @n3zlnluka5 Год назад

    For day 25 I iterated through every pair of directly connected nodes and then calculated the number of distinct shortest paths between them. For example, the amount of ways you can go from jqt to nvd without using the same edge twice, is three. So every connection that satisfies this property means that the connection is one of the bridges. So you will have three connections that have 3 distinct paths between them and all the rest of the connections will have 4 distinct paths. This is Menger's theorem.

  • @n0ne0ne
    @n0ne0ne Год назад

    what do you use to record the screen?

  • @FiresBZ
    @FiresBZ Год назад +1

    For Day 24, I believe only three hailstones are needed and linear independence is guaranteed IF you factor in time and use three equations per hailstone:
    (x0 - x) + t0 * (x'0 - x') = 0
    (y0 - y) + t0 * (y'0 - y') = 0
    (z0 - z) + t0 * (z'0 - z') = 0
    (x1 - x) + t1 * (x'1 - x') = 0
    (y1 - y) + t1 * (y'1 - y') = 0
    (z1 - z) + t1 * (z'1 - z') = 0
    (x2 - x) + t2 * (x'2 - x') = 0
    (y2 - y) + t2 * (y'2 - y') = 0
    (z2 - z) + t2 * (z'2 - z') = 0
    This makes nine equations for nine unknowns: x, y, z, x', y', z', t0, t1, t2.
    Each hailstone has a different t variable, and each of the three equations for each hailstone covers different components (x, y, z), making the system linearly independent, if I'm not mistaken.
    Seems like the speed is very similar to your solution though, given that you only have six unknowns for the entire system!

    • @TheTrienco
      @TheTrienco Год назад +1

      I had a very simple solution for the example data. With two parallel lines the problem collapses to a single plane (the one the lines are on). Intersect two of the other lines with the plane to get two points on the trajectory of the rock. Subtract them to get velocity, subtract t * velocity from one of the points to get the start position.
      And of course the real data didn't have a single pair of parallel or even co-planar lines, so it didn't apply. Up until that point, I was sure that having parallel lines was the whole trick to the puzzle.

  • @TheTrienco
    @TheTrienco Год назад

    Hm.. maybe I'm missing something, but when you say "Pick's, but there is an easier way" you seem to describe part of Pick's. At least the "lots of 1/4 and 3/4 cancel each other out and you get net 4 x 1/4" is how I understood where the magical +1 in Pick's was coming from.