bjorng
Erlang Core Team
This topic is about Day 1 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 in Elixir:
https://github.com/bjorng/advent-of-code-2021/blob/2e585397128f38c3f249623b6392a73fd46e1b87/day01/lib/day01.ex
And over at the Erlang Forums is my solution in Erlang:
code-shoily
Here’s mine:
advent_of_code/day_01.ex at master · code-shoily/advent_of_code (github.com)
Observations:
chunk_byandchunk_while-s document. Everytime something needs chunking, I reach out forchunk_byand end up usingchunkorchunk_everychunk_every’s:discardAetherus
My solution using
chunk_every/4Part 1
Part 2
code-shoily
omg … why did I not think about
a < band usedb - a > 0instead? Not just the first time but also afterwards when I was looking at it through F#Aetherus
Actually, I did the same thing in Part 1, and realized that I can just write
a < bin Part 2code-shoily
I took the questions quite literally in my head and on code. I was more obsessed with getting in the leaderboard so I can forgive myself for the first time. But I totally should have seen it the second time.
Also, glad to see your code again @Aetherus … I remember taking help from some of your solutions last year
Aetherus
Really? I’m flattered. I had a hard time solving problems in the later days of AoC, maybe I need to polish my programming skills more.
code-shoily
I have been randomly solving Advent of Code problems throughout the year, with Elixir. But whenever I see a problem involving 2D arrays or dynamic programming, regardless of practice, I start to panic. One example that comes to mind is Year 2017, Day 3. The idea of solving that gets me nervous lol.
stevensonmt
TIL
Enum.zip_reduce/3Edited for DRYing.
Aetherus
Exactly. I just worked out the answer to part 1. Part 2 is scary. I can’t find a non-brute-force way of solving it.