Advent of Code 2024 Day 18

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

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

  • @StephenHouser
    @StephenHouser 4 часа назад

    Thank you for the videos and commentary. I watched them all last year and was looking forward to them again this year. Even though I've switched to C++, seeing your Python solutions is still fun.

  • @mathiaskern7031
    @mathiaskern7031 День назад +5

    Part 2: binary search.

  • @GrepHaxs
    @GrepHaxs 23 часа назад +2

    For a faster part2 what I did was track the points in the initial connected path at 1024. Then add the corrupt bits 1 by 1 and check my path to see if the new corrupt point was on my path. Only if it was on my path I re-ran the path finding portion. For my input this reduced the number of times I re ran bfs to 32 with total execution time around 250ms.

  • @pipdjs
    @pipdjs 8 часов назад

    I did astar. For p2 I reversed it (started with all corrupt bytes in) and went until it did find a path, but idk if that was maybe only good for my data (my answer was on line 3000 out of 3400 something)

  • @rastislavsvoboda4363
    @rastislavsvoboda4363 23 часа назад +3

    for p2 I've skipped first 1024 tries, knowing it is reachable ;-); it runs ~2.5s
    nothing fancy was needed

    • @alain_gilbert
      @alain_gilbert 21 час назад +3

      You can also skip doing the bfs entirely if the new points are not on the path. mine run in ~0.03s

  • @AymanAlSairafi
    @AymanAlSairafi День назад +1

    Off by one for me too.. I thought my search algorithm was wrong. Sneaky from Eric to make it so ;-)

  • @rastislavsvoboda4363
    @rastislavsvoboda4363 21 час назад +1

    just tried P2 with binary search
    runs ~100-150ms

  • @shahzodshafizod
    @shahzodshafizod 22 часа назад

    Hi, thanks for daily videos. Can you please share the settings of your vim, syntax highlights and so on. I wanna switch from vs code to vim and researching it. Thanks in advance

  • @waplet
    @waplet 6 часов назад

    also hit the 70+1 error...