From 4a0b5f95fafc278d365e90b0bba7e4fafb3db955 Mon Sep 17 00:00:00 2001 From: Fabian Tessmer Date: Sat, 5 Apr 2025 00:18:46 +0200 Subject: [PATCH] Advent of Code 2015 day 19 part 2: solution lookup --- 2015/day19/problem.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/2015/day19/problem.txt b/2015/day19/problem.txt index c71f511..c0b1aee 100644 --- a/2015/day19/problem.txt +++ b/2015/day19/problem.txt @@ -27,4 +27,27 @@ Your puzzle input describes all of the possible replacements and, at the bottom, Your puzzle answer was 535. -The first half of this puzzle is complete! It provides one gold star: * \ No newline at end of file +--- Part Two --- +Now that the machine is calibrated, you're ready to begin molecule fabrication. + +Molecule fabrication always begins with just a single electron, e, and applying replacements one at a time, just like the ones during calibration. + +For example, suppose you have the following replacements: + +e => H +e => O +H => HO +H => OH +O => HH +If you'd like to make HOH, you start with e, and then make the following replacements: + +e => O to get O +O => HH to get HH +H => OH (on the second H) to get HOH +So, you could make HOH after 3 steps. Santa's favorite molecule, HOHOHO, can be made in 6 steps. + +How long will it take to make the medicine? Given the available replacements and the medicine molecule in your puzzle input, what is the fewest number of steps to go from e to the medicine molecule? + +Your puzzle answer was 212. + +Both parts of this puzzle are complete! They provide two gold stars: **