Advent of Code 2024 - Day 13

Greetings, Erlang aficionados! :wave: Ukrainian Erlanger here! :metal: It’s Day 13, and today we’re stepping into the arcade to tackle the unique challenge of the Claw Machines! :joystick: These aren’t your typical machines - they demand tokens and logic to win the most prizes with the fewest cost. Let’s crack this puzzle with the power of Erlang!

The task: For each claw machine, determine if it’s possible to win the prize by pressing a combination of buttons A and B. Then, find the most prizes you can win and the minimum tokens required to win them.

:bulb: Tips for solving Day 13:

  1. Model the problem as a linear Diophantine equation, where the number of button presses satisfies both the X and Y axis constraints.
  2. Use a brute force approach (up to the 100-press limit) or implement a mathematical solution to efficiently check valid combinations of button presses.
  3. Keep track of the tokens spent and maximize the number of prizes won while minimizing costs.

:sparkles: Motivation for today:
Success in the arcade isn’t about luck - it’s about logic, planning, and the BEAMS’s power. Let’s grab those prizes together!

Share your strategies, solutions, or any roadblocks you’re facing. This is your space to collaborate, debug, and celebrate successes.

Happy coding, and may your claws always align perfectly! :christmas_tree::computer: