bjorng
Erlang Core Team
Note: This topic is to talk about Day 2 of the Advent of Code 2019 .
There is a private leaderboard for elixirforum members. You can join it by following this link and entering the following code:
39276-eeb74f9a
Trending in Challenges
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
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
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bjorng
Here is my solution.
sasajuric
This is my take. It’s not super fast (takes about 2 sec on my machine for part 2), but does the job.
The most interesting part to me is instruction execution. I define the instruction mapping, and then have a generic exec function which interprets the instruction, fetching the correct amount of arguments based on the arity.
qhwa
Nice solution based on
Stream, andFunction.info/1I’ve never thought about beforeHere’s my version.
I did the input parsing in compile time so it was a bit faster. I found that in later puzzles the input might take more time to parse (it happened before).
faried
I’m learning Elixir, and didn’t know about
Enum.find; I couldn’t figure out how to do an early return from insidefor noun <- 0..100, verb <- 0..100, do: ..., so I picked a terrible way to do handle it: spawn 10k processes! (I finished reading the Concurrent Programming section of Programming Elixir last night.)What’s interesting is that I read sasajuric’s solution, adapted it, and it seems to run slower (!) than what I have: 175769 microseconds for my part2, 682567 for theirs. Maybe it’s because of all the destructuring? Both solutions in one file.
egze
Here is mine: aoc/lib/aoc/y2019/d2.ex at master · egze/aoc · GitHub
Thanks @NobbZ for the boilerplate.
xfix
I’m learning Elixir currently, and here is my mine: lib/day2.ex · master · Konrad Borowski / advent_of_code_2019 · GitLab
I’m pretty sure it can be improved, but I quite like what I have here.
NobbZ
Finaly I found some time to do it. And a small typo took me half an hour to figure out the problem… I did
for noun <- 0..99, verb <- 0..9 do … end…egze
That’s cool. Didn’t know about
:arrayfrom Erlang.sasajuric
My first guess would be that your solution is faster b/c you’re using spawn, which means you’re leveraging multiple cores. The
Enum.findversion is sequential.egze
How about we get a little private leaderboard for elixirforum going?
Because the public leader board is insane, people solve the challenges in minutes. wtf