Bridge Repair [Day 7 - Advent of Code 2024 - Python]

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

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

  • @boogieman97
    @boogieman97 26 дней назад +1

    Thanks again 0xdf, awesome as always. Anything else up to your sleeve apart from Advent of Code?

    • @0xdf
      @0xdf  17 дней назад

      Working on Hackvent and Holiday Hack as usual!

  • @axtrat
    @axtrat 26 дней назад

    I think the order on witch you try the operands can impact how fast the program runs.

    • @0xdf
      @0xdf  26 дней назад

      Interesting. Why?

    • @axtrat
      @axtrat 26 дней назад

      @@0xdf my bad, it doesn't😅, i was hoping that the lazy evaluation could do some pruning

  • @jameselkins7527
    @jameselkins7527 26 дней назад

    Instead of `target / num == target // num` to check for integer why not `target%num == 0`?

    • @davidforsythe181
      @davidforsythe181 26 дней назад +1

      Yeah, that's smarter! Saw that when looking into solutions too.

    • @boogieman97
      @boogieman97 26 дней назад

      Yeah anything could be highlighted. Apart from the purism in code best practices, what 0xdf is trying to show is the creativity in his line of his thought to solve these increasingly getting complex coding challenges. Similar to "in range(len(" could be enumerate, on the other hand he is using "map" very wisely. Lets focus on the narrative

    • @jameselkins7527
      @jameselkins7527 25 дней назад

      @@boogieman97 wasn't trying have a gotch a moment. He is a much better python dev than me and I've learned a lot just watching his AoC videos. Just wanting to learn why that might be a preferable way or if it was just how he likes to do it. Is it more performance, for example.

    • @0xdf
      @0xdf  17 дней назад

      All good. I'm not offended. They are probably equally performant, and yours is easier to read, so I'd go with that!