Day 3: Mull It Over | Advent of Code 2024

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

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

  • @jesuscruz8008
    @jesuscruz8008 15 дней назад

    i did part 1 with a re but for part 2 I was reading the file in chunks and checking if do or dont is in their and if not I would process the entire buffer but your solution is wayyyyy better Im going to practice more re expressions cause I overcomplicated things haha

  • @juanmacias5922
    @juanmacias5922 22 дня назад +5

    I forgot AOC could also be called Advent of Regex LMFAO

    • @MichaelDoornbos
      @MichaelDoornbos 22 дня назад +1

      Regex is the one time I cheat and look up what I'm doing in the documentation. After all these years, I've still not memorized a damn thing ;-)

    • @juanmacias5922
      @juanmacias5922 21 день назад +1

      @@MichaelDoornbos BRO! I feel understood HAHA

  • @degreesofaccuracy
    @degreesofaccuracy 21 день назад +1

    I should probably learn regular expression

  • @harrisonle2998
    @harrisonle2998 21 день назад +1

    Good solution. The part
    if match[2] == "do()":
    enabled = True
    else:
    enabled = False
    might be simplified to: enabled = match[2] == "do()"

    • @WilliamYFeng
      @WilliamYFeng  21 день назад +1

      true! thanks for pointing that out

    • @heathcliff5104
      @heathcliff5104 16 дней назад

      no, it can not. If enabled is False, but it matched some numbers (e.g. ('1', '2', '')) then enabled = match[2] == "do()" will give False, and it will break the logic, you try to run with your version