ADVENT OF CODE 2024 | Day 2 Jackie's Python Solution

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

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

  • @unalive_me
    @unalive_me 4 дня назад

    Thank you! I was trying to stick through this one, and I knew what was wrong, but didn't know how to implement this. Better to have an O(n^2) solution than none!

    • @CSJackie
      @CSJackie  3 дня назад +1

      haha yes exactly

  • @paktric
    @paktric День назад

    For part 2 I did the same thing, remove one element at a time to see if the "new" array is safe. It felt very brute-force but I can't think of a better way to do it 🤔

  • @Skeiln
    @Skeiln 5 дней назад

    I recently found you on youtube and i liked it a lot ;D I work as a software developer using C#, done Python in the past, great languages
    I like the videos you make, its interesting and nice to see how you go over it all and explain it so well, keep it up please its enjoyable to watch you and your videos

  • @flaviomoreira01
    @flaviomoreira01 3 дня назад

    I am using this challenge to learning GO and it has been brutal because galang does lack some of the niceties found in other programming languages. But I am sticking to it.

  • @burgek1
    @burgek1 4 дня назад +3

    I really need to make some time to learn the numpy module as it's clearly very useful!

    • @CSJackie
      @CSJackie  3 дня назад

      it is! I only know a few tricks, it's very comprehensive

  • @Kushal-v8b
    @Kushal-v8b 5 дней назад +1

    Great 👍 I have used python language for my data science projects

    • @CSJackie
      @CSJackie  5 дней назад +1

      Nice work! ☺️

  • @RahulYadav-luckyrj
    @RahulYadav-luckyrj 5 дней назад +1

    Good to learn ..🎉

    • @CSJackie
      @CSJackie  5 дней назад +1

      Yay thanks 🥳

  • @ac8764
    @ac8764 5 дней назад +6

    can you pls deactivate, the ai voice translation, from youtube, its hella annoying to change the voice line back, thx

    • @CSJackie
      @CSJackie  5 дней назад +3

      I’m so sorry, I didn’t do anything, seems to be a new RUclips feature. I will check how to turn it off before posting!

    • @juanmacias5922
      @juanmacias5922 5 дней назад +1

      I wonder if it's based on a setting or whichever RUclips perceives your native language to be because I've seen a couple comments on other videos, but my audio has been set to original on all of them.

  • @slickheisenberg8208
    @slickheisenberg8208 17 часов назад

    How are we supposed to read this tiny editor window?
    It’s basically impossible to read on a t tablet.

  • @samoylov1973
    @samoylov1973 18 часов назад

    from itertools import pairwise as pair
    filename = "nums.txt"
    def number_generator(filename):
    with open(filename, 'r') as file:
    for line in file:
    yield list(map(int, line.split()))
    def check_nums(gen):
    for i in gen:
    one_to_three, decreasing, increasing = [], [], []
    for x, y in pair(i):
    one_to_three.append(abs(x - y) in range(1, 4))
    decreasing.append(x - y > 0)
    increasing.append(y - x > 0)
    combined = [all(decreasing), all(increasing)]
    result = all([all(one_to_three), any(combined)])
    result = "Safe" if result else "Unsafe"
    print(*i, result)
    check_nums(number_generator(filename))

  • @nazd5594
    @nazd5594 5 дней назад

    What's your vscode theme btw?

  • @fourbytes1
    @fourbytes1 4 дня назад +1

    I always feel uncomfortable solving puzzles using libraries as if it's cheating. :)

    • @CSJackie
      @CSJackie  4 дня назад +1

      I feel you haha but hey it would just be a bunch of loops otherwise. It felt more elegant 😊

  • @imkir4n
    @imkir4n 5 дней назад +1

    Jackieeeeee

  • @mnick-lj7kg
    @mnick-lj7kg 5 дней назад +1

    I'm struggling so much with part2 whereas part1 was quick. Is anyone has solved part 2 without brute force approach ?

    • @CSJackie
      @CSJackie  5 дней назад +3

      Would love to know as well 😂 my solution is not very ~elegant~ but I just wanted to go to sleep lol

  • @mathiouz007
    @mathiouz007 4 дня назад

    ouais t'es la secretaire quoi

  • @AbdulrahmanAlmyman
    @AbdulrahmanAlmyman 4 дня назад

    Make fruit detection project 🍉🍇🍌🍍🍎🍒🫐 😆😆😆 .
    Make ML projects.

  • @kshitijbafna
    @kshitijbafna 5 дней назад +1

    i'm surprised np.diff() exists 😂

    • @CSJackie
      @CSJackie  5 дней назад +1

      Same - I learned of it recently