Advent of Code 2024 Day 21

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ • 9

  • @artemistrubacheev7704
    @artemistrubacheev7704 День тому +6

    A really tough one! I misinterpreted part of the lore where it says “-40 degrees” and for like 3 minutes thought I will have to type on a rotated keypad :D

    • @NStripleseven
      @NStripleseven 20 годин тому

      Yea some of the stuff I don’t know why they bolded

  • @cedw
    @cedw День тому +3

    World class thumbnail

  • @Bundas102
    @Bundas102 5 годин тому

    This day's part2 was the first time this year that I couldn't do it in one sitting. I had to relax a bit and do something else bc it broke my brain :D Definitely the hardest one so far

  • @MattDog_222
    @MattDog_222 18 годин тому

    Using some inspiration from memoized solutions on reddit i basically had `static long cheapestMove(int start, int end, int upstreamRobots, int deadzone)` which generates the ways to move from start to end index, ignoring deadzone, and finds the min of those by calling a helper method(String sequence, int upstream) which recursively invokes the cheapestMove for each move in the sequence. And cheapestMove memoizes the result of all 4 args.

  • @God-i2
    @God-i2 День тому +1

    HAHA, you can tell from thumbnail if Neil had an easy time with the problem or not😂

  • @yemiez
    @yemiez 23 години тому +1

    This one sure made my head hurt a lot, it took me wayyyyyy to long to realise the shortest sequence for any N robot doesn't matter if it doesn't produce the shortest sequence of another later one..

    • @NStripleseven
      @NStripleseven 20 годин тому +1

      That’s a critical piece. There are so many sequences that look equivalent lengthwise but aren’t because all but one screw you over when you’re generating a robot’s input earlier in the chain.

  • @joule162534
    @joule162534 13 годин тому

    i have solved it but took me several hours... my solution for part 1 was very sub-optimal and i had to come up with a different approach for part 2.
    not happy with this day but at least solved