Aetherus
This topic is about Day 7 of the Advent of Code 2020 .
Thanks to @egze, we have a private leaderboard:
https://adventofcode.com/2020/leaderboard/private/view/39276
The join code is:
39276-eeb74f9a
I become busy this week, so I may not be able to create such topics in time. Apologies in advance.
Trending in Challenges
Other Trending Topics
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
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
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
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
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 17 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Aetherus
Actually, your code is quite readable.
adolfont
I am not doing it every day, so only today I solved Day 7.
Ugly code, I believe.
https://github.com/Introduction-to-Functional-Programming/simple_exercises/blob/main/adolfont/adventofcode/2020/day_07/lib/day07.ex
stevensonmt
I was one short. I think on the final match I was returning before adding it to the stack, but not sure.
adamu
Maybe you counted the shiny gold bag.
jarimatti
I modeled the data as directed graph where the edge label is the count of bags inside the source bag using Erlang
:digraphand:digraph_utils. Part 2 turned out with similar (not tail-recursive) structure. Not the most elegant but gets the job done:The benefit of
:digraphis in the solution for first part:where
Digraph.reaching/2is defined as:jarimatti
That’s a nice implementation of
count_bags/2, much more readable than what I managed to do.stevensonmt
Starting to get a little tough. I managed to get this after examining some of the solutions posted here. I had a naive solution for part 1 that was off by one and I can’t figure out why. Since my final solution was derivative of other posts here not posting it but wanted to say thanks for everyone who did post their solutions for providing the guidance.
ricardo-h
part2 bad parse - can be improved
egze
Used the libgraph library.
GitHub
dominicletz
I was first afraid there could be loops or sth. but seems fine. Here second solution: