bjorng
Erlang Core Team
Here is my solution for day 2 of Advent of Code:
https://github.com/bjorng/advent-of-code/blob/main/2024/day02/lib/day02.ex
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
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 27 to 18- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dimitarvp
Life sadly kept getting in the way but ultimately:
Did my best to make it readable and intuitive, even benchmarked three competing implementation I had ideas about, and only posted the one that won.
Adzz
Okay a little late to this one. My part 1 halts as soon as we see an error.
Part two is a little more complex but it does not use
List.delete_ator anything. It stops as soon as there are more errors than is legal to correct. To satisfy the edge cases you have to attempt each starting sequence if any fail before you can rule the report unsafe.Could probably make it shorter. But you definitely don’t have to try deleting each element in the list in turn you can be a bit more surgical so I think we avoid the combinatorial explosion.
Part 1
Part 2
stevensonmt
I tried something similar that ended up not working. My idea was to find how many inflection points there were in the series. If there were only two direction changes and the length of the middle segment was only one item you just need to know if the item before and the item after satisfy the distance rules.
I had something like
If you have one chunk the list is sorted. If you have two chunks and the second one has a single item dropping the last item in the list would make it sorted. If you have three chunks and the middle chunk has a single pair, dropping the second item in that pair would make the list sorted.
I just couldn’t figure out how to include the max distance criteria.
donaldww
mwilsoncoding
Long time lurker, using the advent as an excuse to say hi. =]
Here are my solutions for today.
Part 1:
Part 2:
dimitarvp
Reminds me of one of George Carlin’s tidbits for when politicians are deflecting blame:
akin
My solution for day 2:
BartOtten
My solution to today’s story.
Possible optimizations:
ntalfer
I’ve ended up doing something that stops computation asap instead of brute force all possibilities.
NobbZ
My second day solution took me much longer than necessary.
I managed to get most of it done between getting the kids to the bus and having my first meeting of the day. Though part B was off… And throughout the day, I took some minutes between meetings or during breaks to try to fix this.
Now, 12 hours after I have started the AoC day, I found a working solution, and in hindsight, my previous iterations, either skipped the variant with only the first or the last level, which lead to skewed results
https://gitlab.com/NobbZ/aoc_ex/-/blob/main/lib/y2024/d02.ex?ref_type=heads