Day 7: Laboratories

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 10 months ago* (last edited 10 months ago) (2 children)

Uiua

A bit late getting to this, but happy with this solution, despite it being nothing more than just building/summing all paths. As usual, you can drop your own file onto that solution.

D ← ".......S.......\n...............\n.......^.......\n...............\n......^.^......\n...............\n.....^.^.^.....\n...............\n....^.^...^....\n...............\n...^.^...^.^...\n...............\n..^...^.....^..\n...............\n.^.^.^.^.^...^.\n..............."
# D ← &fras"AOC2025day07.txt" # <- Uncomment and drop file here.

Parse ← βŠƒβ†˜β†™1β‰ @.βŠœβˆ˜βŠΈβ‰ @\n
Flow  ← βŠƒ(+βŠƒβ†»β‚β†»β‚‹β‚Γ—|Γ—Β¬)βŠ™βŠΈβŠ£
P₁    ← /+>0β™­β¬š0Γ—βŸœβˆ§(ΛœβŠ‚β†₯Flow)
Pβ‚‚    ← /+⊣∧(ΛœβŠ‚+Flow)
βŠƒP₁ Pβ‚‚ Parse D
  • source
  • hideshow 2 child comments
  • [–] 2 points 10 months ago (1 child)

    Man, your solution is so much cleaner than the hell I was trying (and failing) to coerce into doing what I wanted. Curse my inability to think bottom-up and array-oriented at the same time!

  • source
  • parent
  • hideshow 1 child comment