NobbZ
Note by the Moderators: This topic is to talk about the Day 2 of the Advent of Code.
For general discussion about the Advent of Code 2018 and links to topics of the other days, see this topic.
This is my todays code:
I’m not quite happy with it though, but it runs in ~4ms/~8ms, so I leave it as is for now.
Trending in Challenges
Other Trending Topics
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
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
- #ai
- #umbrella
- #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 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sorentwo
I’m doing my problems in Elixir this year as well: GitHub - sorentwo/aoc_2018: Advent of Code 2018 · GitHub
My solution today seems a little different from the others I’ve seen. I made use of
String.myers_difference/2for the second part:There are two other possible edit scripts that could have matched (first character or last character being the difference), but this worked for my inputs.
yawaramin
I’m pretty happy with my solutions so far, especially for Day 2 Part 2 I felt I was able to take advantage of a few things, especially a comprehension to structure it nicely:
debajit
I had a lot of fun doing Day 2 Part 2.
I like how this one turned out — reasonably small and clean.
I’ve learned that finding the right functional operation (
Enum.find_valuein this case) really helps keep the code small (and easy to reason about). (String.myers_differencehelped, of course. I wrote my first version with MapSet (and set difference and intersections), which interestingly worked for the example case, but did not work with the large input file, so I ended up usingString.myers_difference)