# Advent of Code 2024 - Day 11

**URL:** <https://erlangforums.com/t/advent-of-code-2024-day-11/4281>\
**Category:** Coding Challenges\
**Tags:** advent-of-code\
**Created:** [December 11, 2024, 8:22am UTC](https://erlangforums.com/t/advent-of-code-2024-day-11/4281 "2024-12-11T08:22:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vkatsuba](https://erlangforums.com/user_avatar/erlangforums.com/vkatsuba/32/314_2.png) [@vkatsuba](https://erlangforums.com/u/vkatsuba)\
**Post date:** [December 11, 2024, 8:22am UTC](https://erlangforums.com/t/advent-of-code-2024-day-11/4281/1 "2024-12-11T08:22:27Z")

</div>

Greetings, Erlang adventurers! 👋 **Ukrainian Erlanger** is here! 🤘 **[Today](https://adventofcode.com/2024/day/11)**, we delve into the mysterious world of **Plutonian Pebbles**. 🪨 As we observe the spacetime-manipulating stones and decipher their strange transformations, it’s time to showcase the power of **Erlang** for recursive and rule-based problems. 🚀

The task: Simulate the evolution of the stones over 25 blinks, following their specific transformation rules. The challenge grows with the stones splitting and multiplying - this is a perfect opportunity to use Erlang’s robust pattern-matching and recursion!

💡 **Tips for tackling Day 11:**

- Start by parsing the initial stone numbers into a list for easy manipulation.
- Use recursion to handle each “blink,” applying the transformation rules systematically.
- Be mindful of performance - efficiently handling the exponential growth of stones is key to solving the problem for larger inputs.

✨ **Motivation for today:**  
Great things are done one step (or one blink) at a time. Let’s evolve, transform, and Beam together!

Share your approaches, insights, and solutions below. Whether you’re puzzling over splitting stones or tackling the multiplication rule, this is your space to collaborate and learn.

Happy coding, and may your stones always align perfectly! 🎄💻

---

<div class="post-metadata">

**Author:** ![chiroptical](https://erlangforums.com/user_avatar/erlangforums.com/chiroptical/32/2044_2.png) [@chiroptical](https://erlangforums.com/u/chiroptical)\
**Post date:** [December 12, 2024, 3:29am UTC](https://erlangforums.com/t/advent-of-code-2024-day-11/4281/2 "2024-12-12T03:29:31Z")

</div>

I tried the explicit recursive version without any state. It worked for part 1 but would have taken ages to finish for part 2. I asked my colleagues for a hint and ended with [advent\_of\_code\_2024/src/solution\_day\_11\_2024.erl at main · chiroptical/advent\_of\_code\_2024 · GitHub](https://github.com/chiroptical/advent_of_code_2024/blob/main/src/solution_day_11_2024.erl) (the hint was basically a data structure). It was so obvious after the hint.

I feel like we had one of these last year and I made the same mistake.

---

<div class="post-metadata">

**Author:** ![chiroptical](https://erlangforums.com/user_avatar/erlangforums.com/chiroptical/32/2044_2.png) [@chiroptical](https://erlangforums.com/u/chiroptical)\
**Post date:** [December 12, 2024, 3:31am UTC](https://erlangforums.com/t/advent-of-code-2024-day-11/4281/3 "2024-12-12T03:31:12Z")

</div>

The recursive one with no storage optimizations [advent\_of\_code\_2024/src/solution\_day\_11\_2024\_old.erl at main · chiroptical/advent\_of\_code\_2024 · GitHub](https://github.com/chiroptical/advent_of_code_2024/blob/main/src/solution_day_11_2024_old.erl) (if you’re curious)

---

<div class="post-metadata">

**Author:** ![vkatsuba](https://erlangforums.com/user_avatar/erlangforums.com/vkatsuba/32/314_2.png) [@vkatsuba](https://erlangforums.com/u/vkatsuba)\
**Post date:** [December 12, 2024, 8:39am UTC](https://erlangforums.com/t/advent-of-code-2024-day-11/4281/4 "2024-12-12T08:39:28Z")

</div>

Great to see you tackling it! The recursive approach is definitely elegant. Leveraging the right data structure can make all the difference, and it’s always nice to have colleagues to brainstorm with. Learning from past challenges is what makes AoC so rewarding - awesome work adapting and pushing forward! 🚀🎄
