Day 6 - Solutions
catching up yesterday's one
nothing fancy just parsing https://github.com/zelark/AoC-2022/blob/master/src/zelark/aoc_2025/day_06.clj
https://gitlab.com/maximoburrito/advent2025/-/blob/main/src/day06/main.clj
I appreciate that the puzzle input had trailing spaces so each line was the same length.
How did this matter? edit: should have read part 2 π
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 goesThis one is nice. https://github.com/genmeblog/advent-of-code/blob/master/src/advent_of_code_2025/day06.clj
https://github.com/tschady/advent-of-code/blob/main/src/aoc/2025/d06.clj
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
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/
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
@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!
lol. map, map, partition-by, take-nth, map mapcat, map
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
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.