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 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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
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
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










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: