Advent of Code 2023 Day 19: Aplenty

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2024

ความคิดเห็น • 14

  • @mihaimanole2643
    @mihaimanole2643 11 หลายเดือนก่อน +2

    At part2 in for in rules, first if cmp = “

    • @hyper-neutrino
      @hyper-neutrino  11 หลายเดือนก่อน +4

      Interesting. You're correct; I'm surprised that doesn't cause any issues. I fixed the code in the repository; thanks for mentioning this.

    • @mihaimanole2643
      @mihaimanole2643 11 หลายเดือนก่อน

      @@hyper-neutrino Could be that the input from AoC to be selected in the way that those cases to not happen?

    • @YuumiGamer1243
      @YuumiGamer1243 11 หลายเดือนก่อน +1

      @@mihaimanole2643 it could be selected like that specifically, or by random chance that the script works on the selected input.
      I had a day where I had a bug in my code, and it worked on the input of 2 friends, but not on my input.

  • @johncosta27
    @johncosta27 2 หลายเดือนก่อน

    Super cool. I'm still crunching through a few of the last remaining days but part 2 really got to me. Nice explanation :)

  • @tektonick142
    @tektonick142 11 หลายเดือนก่อน +2

    It looks so easy when you do it...👍

  • @Irakli008
    @Irakli008 11 หลายเดือนก่อน

    Great video! Love how concise your code is. In my attempt (TypeScript, not Python, so not sure how different it would be), I put the fallback alongside the other rules (instead of tracking it differently), and I assign it null. Then, when I'm checking all the rules, I check "if (!rule)", in which it case I return true. So in that sense, you can treat the fallback part of the string as yet another rule (that always comes out to true).

  • @meio6907
    @meio6907 11 หลายเดือนก่อน

    Such a clean code, well done

  • @Ziteyt
    @Ziteyt 11 หลายเดือนก่อน +7

    crazy

  • @AlfonsusAC
    @AlfonsusAC 11 หลายเดือนก่อน

    Nicee

  • @bobernhardsson5345
    @bobernhardsson5345 11 หลายเดือนก่อน

    Your code in the video has different definitions of T and F than the code on your github. For instance T = (lo, n-1) in the video, is replaced with the (in my view more correct) T = (lo, min(n-1, hi)) on github. But both versions of code seem to return the same total on the input data! (I can not see why that is though?)

    • @hyper-neutrino
      @hyper-neutrino  11 หลายเดือนก่อน +1

      See the pinned comment

  • @rastislavsvoboda4363
    @rastislavsvoboda4363 11 หลายเดือนก่อน

    I had it little more chatty
    and prepended condition as "" before fallback node
    def count_accepted(intervals, node, G):
    if node == "A":
    v = 1
    for i_s, i_e in intervals:
    if i_s