bjorng
Erlang Core Team
Note: This topic is to talk about Day 12 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
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
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
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
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bjorng
Fun, but tricky!
Here is my solution.
cblavier
Just starting to read the instructions, sound tricky indeed.
Is there a typo in applied velocity example? I believe new x should be 3
bjorng
No, it seems to be correct.
Adding 1 and -2 gives -1. Did you try to subtract -2 from 1?
cblavier
Replying to myself: x velocity is
-2and not simply2It’s going to be tough
QuinnWilton
Part 2 was tough, but I enjoyed it!
I thought I was being clever by walking forward and backward at the same time, but that still took too long.
sasajuric
This is my solution. Takes about 15sec for the second part. I’m not doing it very efficiently since I’m computing per-dimension cycle from scratch, so I have to do three large passes, when I could solve everything in one. I should probably also replace the stream-based logic with
Enum.reduce_whileor a recursion. But I was too lazy for that, and this produced the result within a “reasonable” time.aaronnamba
I couldn’t figure out part 2 on my own, the puzzle title made me read up on the N-Body Problem, which made me
.
After a couple hours of spinning my wheels (and my computer’s fans), I went looking for the tiniest hint (not spoiler/solution) I could find, which I ended up getting from this post from reddit.
Once I got the basic idea, it took just a couple minutes to code up a solution. And that gave me an answer in about 1 second. Sheesh.
My eventual part 2 solution
xfix
I didn’t figure out the trick myself. Oh well.
jenarvaezg
My solution for today, sadly I got spoiled for part2, but I don’t think I’d have come up with the solution by myself anyways
ihabunek
Here is mine. Like many people here, I also required a hint for part 2, so feeling a little stupid. But after that had no problems and the program runs under 1 second.