bjorng
Advent of Code 2019 - Day 12
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
Most Liked
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_while or a recursion. But I was too lazy for that, and this produced the result within a “reasonable” time.
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.
qhwa
After some failed attempts, I realized that it requires seeing the problem in a different view point. Brute force would not work anymore. I didn’t find the solution immediately. It was frustrating but I let it go.
When I had time this evening, I read the data carefully once again, and thought, maybe I can try separating their positions and velocities of 3D into three groups of 1D data, that would significantly lower the pressure.
So I took it a try and fortunately it worked!
Here’s the solution I end up with. I’m so glad I learned this new pattern. 
BTW. It finished part 2 in 580ms on my laptop. Not bad.
bjorng
Fun, but tricky!
Here is my solution.







