adventofcode

Maravedis 2024-12-25T05:21:06.346749Z

Day 25 - Solutions

Jasper 2024-12-25T08:03:13.358639Z

Ahh thanks that makes sense. Was thinking something fishy was going on there... πŸ™‚

Jungwoo Kim 2024-12-25T09:30:15.074789Z

This is my first year with participating in AOC on December and I totally get 32 ⭐. I know this isn't much accomplishment for someone but I'm so proud of myself! For me, I used to work with Clojure but not anymore cuz I found a new job. I've missed it so much and I'm so happy now with Advent of Clojure! Thank you all here to get me inspired a lot everyday on slack thread.

tildedave 2024-12-25T11:31:13.021219Z

this is the kind of problem that's really fun to code in a Lisp. nothing quite like read the file, map grid parse, filter it all, https://github.com/tildedave/advent-of-code/blob/main/src/advent2024/day25.clj thanks for all the tips and tricks in the thread this year, was great to participate and see how other people solved this stuff πŸ™‚

jvuillermet 2024-12-25T11:40:41.454899Z

stuck on part 1 and not sure why. works well on example I have 250 locks and 250 keys in my data. Does it sound right?

jvuillermet 2024-12-25T11:41:40.905339Z

I get an answer that's too high and not sure what to check anymore πŸ˜…

Maravedis 2024-12-25T12:15:30.554839Z

SHow your code and we might be able to give you a hint ?

jvuillermet 2024-12-25T12:22:32.122849Z

indeed, I was going to share but just found the issue: i was using (zipmap [4 3 4 0 2] [1 2 0 5 3]) which works by accident on the example input. I do this mistake regularly coming from scala where zip is a function to zip 2 collections in a new one

misha 2024-12-25T13:50:24.432059Z

yeah, zipmap overwrites duplicate keys, need to (map vector xs ys) instead.

πŸ‘ 1
bhauman 2024-12-26T04:42:01.941349Z

Thanks everyone! It was great to share AOC 24 with y’all. https://github.com/bhauman/adv2024/blob/main/src/adv2024/day25/sol.clj

(def input (->> (string/split-lines (slurp "src/adv2024/day25/input.txt"))
                (partition-by string/blank?)
                (filter #(< 1 (count %)))
                (map #(->> (apply mapv vector %)
                           (map (comp dec count (partial filter #{\#})))
                           (vector (ffirst %))))
                (group-by first)
                vals))

(defn try-keys [[kys locks]]
  (for [[_ k] kys
        [_ l] locks
        :when (every? #(<= % 5) (mapv + k l))]
    1))
#_(->> (try-keys input) count)

🀝 2
🀝🏻 1
Maravedis 2024-12-25T05:22:35.890879Z

Nothing much to say, it's a day 25, those are always very short. Thanks to everyone participating, it really was awesome to feel like part of a group working together on something. I had a lot of fun.

πŸ™Œ 1
πŸ™ŒπŸ» 1
Aleks 2024-12-25T05:31:38.641639Z

It's pretty easy today ^_^ Thanks to everyone! You guys rock! https://github.com/zelark/AoC/blob/master/src/zelark/aoc_2024/day_25.clj

2024-12-25T05:31:47.478099Z

https://gitlab.com/maximoburrito/advent2024/-/blob/main/src/day25/main.clj Still have to finish off yesterday though...

erdos 2024-12-25T05:42:53.012909Z

A quick solution. Thanks for the great discussions here, I had a lot of fun and learned a lot too. https://github.com/erdos/advent-of-code/blob/master/2024/day25.clj

roklenarcic 2024-12-25T05:45:56.742609Z

Merry Christmas https://gist.github.com/RokLenarcic/0a2300b06b7798f822892a94f95aff75

roklenarcic 2024-12-25T05:49:30.384599Z

That’s clean erdos. Didn’t think to transpose. I was slow as crap today, because I kept trying to do clever things. The whole text about keys and locks threw me for a loop. I thought that keys and locks had to fit exactly, you know like REAL pin tumbler lock. That’s not the case here. So first thing I did was to merge the text maps and look if there were only \#, but that was a bust.

Maravedis 2024-12-25T05:49:57.599989Z

The text definitely was a lot of words to say nothing.

roklenarcic 2024-12-25T05:50:05.821329Z

Worse it was misleading

Apple 2024-12-25T05:50:10.857699Z

day 25 done. Just need to get the other 13 stars :)

⭐ 2
roklenarcic 2024-12-25T05:51:10.383209Z

Keys don’t work like that. Otherwise a key that was just a thin rail would open all doors.

roklenarcic 2024-12-25T05:51:55.567939Z

So yeah,

Maravedis 2024-12-25T05:58:20.775279Z

Well, to be fair, it doesn't say that a key that fit into a lock opens the lock. We're just pruning the keys set for each lock, to know which keys would physically fit so we can test it.

πŸ’― 1
roklenarcic 2024-12-25T06:07:02.890729Z

Ah true

roklenarcic 2024-12-25T06:07:46.532479Z

But a real key fits into a lock even if the key is too high

roklenarcic 2024-12-25T06:08:16.915529Z

again, otherwise it is trivial to guess the tumbler pins

roklenarcic 2024-12-25T06:08:32.299349Z

it’s why pins are on springs

rjray 2024-12-25T06:11:04.157629Z

https://github.com/rjray/advent-2024-clojure/blob/master/src/advent_of_code/day25.clj Can't believe I made a mistake on this one that cost me nearly 10 minutes πŸ™‚. Considering how many days I wasn't able to start when the puzzles opened up (and the fact that I went almost two full days without looking at it at all), I'm pretty content with my final results.

Maravedis 2024-12-25T06:11:19.270339Z

You might need to sprinkle some suspension of disbelief in your puzzle reading, @roklenarcic πŸ˜›

Jasper 2024-12-25T07:32:37.784869Z

Reading was the hardest part of this years AoC πŸ˜† https://github.com/jaspya/advent-of-code/blob/main/2024/clojure/src/day25.clj How are so many people not completing part 2 of today?

Maravedis 2024-12-25T07:36:00.118189Z

You need to have all the other days completed to finish 25part2. Many people did not finish 21 or 24.

Aleks 2024-12-25T05:35:05.329179Z

Ta-da!

πŸ™Œ 5
roklenarcic 2024-12-25T05:53:38.682749Z

This year we had 1 hard day. Probably the easiest year so far.

Maravedis 2024-12-25T06:12:23.405999Z

I choose to believe we're just getting that much better πŸ˜„