adventofcode 2023-12-22

Day 22 โ€” Solutions

@michaeljweaver did you know that clojure 1.11 has update-keys/update-vals? not sure if that corresponds to your map-vals function exactly, just thought I'd mention it

I do know of those, @borkdude but I donโ€™t find myself using them often. Maybe Iโ€™m not good at recognizing opportunities to use them.

@michaeljweaver hah, sorry, I misremembered which solution used map-vals, but it was actually @alexalemiโ€™s solution!

๐Ÿ˜† 1

but probably this does something slightly different :)

Yeah it looks like it might be a little too complicated for update-vals.

it did prompt me to add update-vals and update-keys to squint though ;)

๐Ÿ’ฏ 1

I had a long drive today and thought about the problem. I added some commentary to my https://github.com/wevre/advent-of-code/blob/master/src/advent_of_code/2023/day_22_bricks.clj (mostly for future me).

Yeah, I frequently forget about update-vals and update-keys, but in this case I have some special logic where I remove the key if its children are empty.