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
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (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.