bjorng
Erlang Core Team
This topic is about Day 6 of the Advent of Code 2021.
We have a private leaderboard (shared with users of Erlang Forums ):
https://adventofcode.com/2021/leaderboard/private/view/370884
The entry code is:
370884-a6a71927
Trending in Challenges
Other Trending Topics
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
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
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
- #metaprogramming
- #hex
- #security











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bjorng
Here is my solution:
https://github.com/bjorng/advent-of-code-2021/blob/2605f7079c9cb7350daa5ba7cc13a84dd3e439b7/day06/lib/day06.ex
rugyoga
https://github.com/rugyoga/aoc2021/blob/main/day6.exs
ruslandoga
I went with representing the frequencies as a tuple and a simulation step was:
Full solution
It’d be nice to see an Nx solution here, it fits this problem very nicely.
princemaple
https://github.com/princemaple/aoc/blob/main/2021/day6.exs
code-shoily
I did it the “slow” way the first time and got instant gratification, the later part, not so instant (in fact not all) until I remembered bucket sort
and my good old friends
Enum.frequenciesandMap.merge/3Here’s how the end product looked like:
stevensonmt
struggling with the size of part 2. I want to do this in a mathematical way following an exponential growth equation like
number of fishes * (1 + rate of growth)^number of daysbut this doesn’t work.wasi0013
I enjoyed this one!
code-shoily
I wish I analyzed input properties more before jumping to solving things. The same happened with Bingo, the solution looked different in my head before and after I realized it’s a 5x5 grid all the time.
code-shoily
Looking forward to what you come up with. I was thinking the same thing but got lazy (scared) and backed away.
stevensonmt
I’m going to have to go to bed without solving it. My initial idea was
Bn= B0 x 2^KtwhereB0is the original count for each timer value.Kis 1/7 andt(for part 2) is256 - the original timer value. Just calculate that for each original timer value and then add them together. Not sure how to make it work though.DERP.
Not accounting for the maturation time with each generation.