adventofcode

2025-12-06T04:58:46.605979Z

Day 6 - Solutions

snyssfx 2025-12-07T17:46:15.390539Z

catching up yesterday's one

Aleks 2025-12-06T05:57:21.229109Z

nothing fancy just parsing https://github.com/zelark/AoC-2022/blob/master/src/zelark/aoc_2025/day_06.clj

AC 2025-12-06T06:17:06.415849Z

I appreciate that the puzzle input had trailing spaces so each line was the same length.

πŸ‘ 1
2025-12-06T07:43:40.677879Z

How did this matter? edit: should have read part 2 πŸ˜„

2025-12-06T08:01:21.806569Z

That was nice. Sometimes I think I too often heed bhauman’s advice from some years back of just using edn/read-string as it only saved one splitting on spaces.

(->> (str "(" test-input ")")
     (map #(str "(" % ")"))
     (map edn/read-string)
     (apply mapv vector) ;; transpose
     (map reverse)
     (map eval)
     (reduce +))
sad this doesn’t help me at all for part 2, but so it goes

jurjanpaul 2025-12-06T11:34:12.441909Z

https://jurjanpaul.github.io/ape-cljs-playground/?code=KGRlZiBpbnB1dAogIDs7IHRvIGJlIHJlcGxhY2VkIHdpdGggcmVhbCBpbnB1dAogICIxMjMgMzI4ICA1MSA2NCAKIDQ1IDY0ICAzODcgMjMgCiAgNiA5OCAgMjE1IDMxNAoqICAgKyAgICogICArICAiKQoKKGRlZm4gcGFyc2UKICBbaW5wdXRdCiAgKGxldCBbcm93cwogICAgICAgICgtPj4gaW5wdXQKICAgICAgICAgICAgIChzdHJpbmcvc3BsaXQtbGluZXMpCiAgICAgICAgICAgICAobWFwIChmbiBbbGluZV0gCiAgICAgICAgICAgICAgICAgICAgKHJlLXNlcSAjIlxkK3xcK3xcKiIgbGluZSkpKSldCiAgICAoYXBwbHkgbWFwIHZlY3RvciByb3dzKSkpCgooZGVmIHBhcnNlZCAKICAocGFyc2UgaW5wdXQpKQoKKGRlZm4gcGFydDEgW10KICAoLT4%2BIHBhcnNlZAogICAgICAgKG1hcCAoZm4gW2V4cHJdCiAgICAgICAgICAgICAgKC0%2BPiBleHByCiAgICAgICAgICAgICAgICAgICAobWFwIHJlYWQtc3RyaW5nKQogICAgICAgICAgICAgICAgICAgKCMoY29ucyAobGFzdCAlKSAoYnV0bGFzdCAlKSkpCiAgICAgICAgICAgICAgICAgICBldmFsKSkpCiAgICAgICAocmVkdWNlICspKSkKCihwcmludGxuICJwYXJ0MToiIChwYXJ0MSkpCgooZGVmbiBwYXJzZS1jb2x1bW4KICBbY29sdW1uXQogICh3aGVuLW5vdCAoZXZlcnk%2FIHN0cmluZy9ibGFuaz8gY29sdW1uKQogICAgKGxldCBbb3BlcmF0b3IKICAgICAgICAgIChjYXNlIChsYXN0IGNvbHVtbikKICAgICAgICAgICAgIisiICsKICAgICAgICAgICAgIioiICoKICAgICAgICAgICAgbmlsKQogICAgICAgICAgb3BlcmFuZCAocGFyc2UtbG9uZyAoc3RyaW5nL3RyaW0gKGFwcGx5IHN0ciAoYnV0bGFzdCBjb2x1bW4pKSkpXQogICAgICAoaWYgb3BlcmF0b3IKICAgICAgICBbb3BlcmF0b3Igb3BlcmFuZF0KICAgICAgICBbb3BlcmFuZF0pKSkpCgooZGVmbiBwYXJ0MiBbXQogICh0cmFuc2R1Y2UgKGNvbXAKICAgICAgICAgICAgICAobWFwY2F0IHBhcnNlLWNvbHVtbikKICAgICAgICAgICAgICAocGFydGl0aW9uLWJ5IGludGVnZXI%2FKQogICAgICAgICAgICAgIChwYXJ0aXRpb24tYWxsIDIpCiAgICAgICAgICAgICAgKG1hcCAoZm4gW1tbb3BlcmF0b3JdIG9wZXJhbmRzXV0KICAgICAgICAgICAgICAgICAgICAgKGFwcGx5IG9wZXJhdG9yIG9wZXJhbmRzKSkpKSAKICAgICAgICAgICAgICsKICAgICAgICAgICAgICgtPj4gaW5wdXQKICAgICAgICAgICAgICAgICAgc3RyaW5nL3NwbGl0LWxpbmVzCiAgICAgICAgICAgICAgICAgIChhcHBseSBtYXAgdmVjdG9yKSkpKSAKIAoocHJpbnRsbiAicGFydDI6IiAocGFydDIpKQo%3D&checksum=LTM5OTE2NjQxMw%3D%3D Not yet the weekend challenge that was anticipated. πŸ™‚ Per usual using transduce here is a good excercise, but it’s not necessary to actually solve the problem.

πŸ‘ 1
benoit 2025-12-06T14:31:12.451409Z

Once part1 was done, it took me a while to switch from thinking in terms of column of numbers to column of characters (lesson in design: after you misunderstand the problem it takes extra effort to shift your perspective) πŸ™‚ https://github.com/benfle/advent-of-code/blob/main/src/advent_of_code/2025/06.clj

πŸ‘ 1
narimiran 2025-12-06T16:15:35.351909Z

Today interactive development with REPL was godsend for Part 2. It took a while until I got exactly what I needed: https://narimiran.github.io/aoc2025/src/day06/

Andrew Byala 2025-12-06T17:49:09.178439Z

Here's mine. Thanks to @narimiran for reminding me of take-nth! β€’ Blog: https://github.com/abyala/advent-2025-clojure/blob/main/docs/day06.md β€’ Code: https://github.com/abyala/advent-2025-clojure/blob/main/src/advent_2025_clojure/day06.clj

narimiran 2025-12-06T18:10:15.481629Z

@abyala Oh, so there are people (ok, just one person confirmed) who read my notebooks? πŸ™‚ Btw, nice usage of \S for the regex pattern! That didn't cross my mind. And I see both us decided to highlight multi-collection capability of map - it really is quite handy!

πŸ‘ 2
Logan Turner 2025-12-06T19:09:33.137569Z

lol. map, map, partition-by, take-nth, map mapcat, map

rjray 2025-12-06T20:57:53.020529Z

I did part 1 by putting all elements into a matrix then transposing it. This gave me rows with the related numbers in which the last element was the operand. For part 2, I put the whole input into a matrix of characters, rotated it counter-clockwise, and stringified the resulting rows. This gave me a sequence of strings in which each was one of: β€’ Number by itself β€’ Number followed by operand β€’ Entirely spaces Dealt with each accordingly. https://github.com/rjray/advent-2025-clojure/blob/master/src/advent_of_code/day06.clj

Sam Ferrell 2025-12-06T22:32:50.749119Z

https://github.com/samcf/advent-of-code/blob/main/2026-06-trash-compactor.clj For part 2, just walked an index backwards from right to left, character by character, collecting the digits on each line and adding the result to a sum when I hit an operator.