Skip to content

Instantly share code, notes, and snippets.

@veader
Created January 5, 2016 19:13
Show Gist options
  • Save veader/c2dfa95982c9a91b5253 to your computer and use it in GitHub Desktop.
Save veader/c2dfa95982c9a91b5253 to your computer and use it in GitHub Desktop.
--- 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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment