woojiahao
Fun day today! Quite straightforward but the key observations are:
Spoilers
- Finding the column-wise reflection line is the same as transposing the pattern and finding the row-wise reflection line so we just need to develop 1 search algorithm
- Smudges correspond to the differences between rows, so if the total differences is exactly 1, then a smudge can exist
- We only need to compare between the minimum between the (top, bottom) from the reflection line, this saves a teeny bit of time
https://github.com/woojiahao/aoc/blob/main/lib/aoc/2023/day_13.ex
Trending in Challenges
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
rugyoga
lud
Easier than yesterday
https://github.com/lud/adventofcode/blob/main/lib/solutions/2023/day13.ex
Today I learnt that you can match a 0-length binary part in a patter.
Each pattern is a list of string, so to change a smudge I need to update the string at list index Y and change a character in that string at index X. The following code works when X is zero.
I used
Stream.resourceinstead ofStream.unfoldbecause it lets you return an empty list, which is convenient to reset the stream state to X=0 and Y+1.Aetherus
I’m so not proud of my code. Just a pile of junk. Ctrl+C & Ctrl+V everywhere. Anyway, I post it here.
https://github.com/Aetherus/advent-of-code/blob/master/2023/day-13.livemd
tywhisky
I have optimized the code as much as possible to make it appear more comprehensible. If there are any parts that someone doesn’t understand, I am more than willing to add additional comments.
Solution
bjorng
The approach I took for solving part 1 was not useful for part 1, so I had to rewrite my solver so that it was able to handle part 2.
My solution:
https://github.com/bjorng/advent-of-code-2023/blob/main/day13/lib/day13.ex
lud
Nice usage of bit strings
hauleth
Day 13
Setup
Part 1
Part 2
trnasistor
My beginner’s solution, Day 13 part 1. Point of Incidence
midouest
Went with Nx again for today’s problem.
Part 1
Part 2
stevensonmt
I probably over complicated parsing the input, but it worked really well. One thing that got highlighted (for me again) was that the
:etsmodule is kind of non-ergonomic. Like there’s noupdate_or_insertorinsert_newtype of functions. I was feeling pretty clever about how easy it was to add the smudge factor to part 1 and make it reusable.One of my favorite things about AoC is seeing the various different approaches. What I’ve learned is that the way the data gets structured really dictates how you are able to approach the logic. Often when I’m trying to understand the solutions from others I find I’m struggling because I set up the data so differently that I can’t shift my head around to the flow of the data through their solution.