sasajuric

sasajuric

Author of Elixir In Action

Note: This topic is to talk about Day 18 of the Advent of Code.

For general discussion about the Advent of Code 2018 and links to topics of the other days, see this topic.

Showing Posts 1 to 4

sasajuric

sasajuric OP

Author of Elixir In Action

Here is my take. I solved part 2 by detecting cycles. It’s not super fast, finishes in about 7 sec. There’s some room for optimizing, but I didn’t want to uglify the code :slight_smile:

bjorng

bjorng

Erlang Core Team

I had fun with streams in this one. I also implemented a cycle finding algorithm.

Running the cycle finding algorithm on the infinite stream turned out to be too slow, though, so I cheated a little by pulling out 2000 values to a finite enumerable. That is probably long enough to work for most people’s data sets. The cycle in my data starts at 452 minutes.

It finishes in about 12 minutes.

@sasajuric I liked the elegant way in which you cached the data from the infinite stream and detected the cycle at the same time.

Update: Forgot the link.

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I caught up just in time to go on vacation: here’s my solution to Day 18:

https://github.com/JEG2/advent_of_code_2018/blob/master/day_18/settlers_of_the_north_pole.exs

marekciupak

marekciupak

— All posts loaded —

Where Next? Top

Trending in Challenges Top

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
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
Damirados
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews