adventofcode

wevrem 2023-12-22T08:10:07.474319Z

Day 22 โ€” Solutions

borkdude 2023-12-22T15:21:33.022949Z

@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

wevrem 2023-12-22T19:56:15.205949Z

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.

borkdude 2023-12-22T19:59:29.130279Z

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

๐Ÿ˜† 1
borkdude 2023-12-22T20:00:20.586839Z

but probably this does something slightly different :)

wevrem 2023-12-22T20:02:38.879069Z

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

borkdude 2023-12-22T20:04:24.451669Z

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

๐Ÿ’ฏ 1
wevrem 2023-12-23T03:15:51.247109Z

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).

2023-12-23T13:38:11.678709Z

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.