bjorng
Erlang Core Team
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
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
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
code-shoily
I was expecting a hard one, this being Friday and all. But it was pleasant to work with.
advent_of_code/lib/2023/day_09.ex at master · code-shoily/advent_of_code (github.com)
hauleth
Just the core:
Part 1:
Part 2:
lud
A bit lenghty but optimizing for not having to call
Enum.all?(list, fn n -> n == 0 end)Aetherus
Share my failure on Part 1
I was trying polynomial regression, and it explodes
The regression function for working out the coefficients of the polynomial:
And the function for predicting the last value of a line:
lbm364dl
Not sure if unfold was the best choice for this use case but it ended up quite clean.
nico.t
yeah this day was very easy
in p1 I accumulated only last element of each sub-line before predicting history as I anticipated there would be memory issues in p2 if you were accumulating all sub-lines
…but p2 was as easy as p1
igorb
At first I used
reduce_while/3to solve it, but then switched toStream.unfold/2inspired by @lbm364dl:https://github.com/ibarakaiev/advent-of-code-2023/blob/main/lib/advent_of_code/day_9.ex
woojiahao
Did not know there was an AoC thread here! This is my approach:
https://github.com/woojiahao/aoc/blob/main/lib/aoc/2023/day_9.ex
midouest
Busted out the recursive functions today:
Part 1
Part 2
trnasistor
There’s a private leaderboard you can join using the code
3241528-139712b3.My solution works with the test but the actual input sequences aren’t becoming all zeros at the end, there’s a single non-zero value that I’m unable to get rid of.
For example:
becomes
Maybe I’m misunderstanding the challenge.