Day 23 part 2 README (part 1 done with pen/paper)

This commit is contained in:
2022-03-26 16:49:27 +01:00
parent f807acc983
commit c78a3e7285
2 changed files with 228 additions and 2 deletions

View File

@@ -98,4 +98,230 @@ Finally, the last Amber amphipod moves into its room, using 8 energy:
What is the least energy required to organize the amphipods?
To begin, get your puzzle input.
Your puzzle answer was 11120.
The first half of this puzzle is complete! It provides one gold star: *
--- Part Two ---
As you prepare to give the amphipods your solution, you notice that the diagram they handed you was actually folded up. As you unfold it, you discover an extra part of the diagram.
Between the first and second lines of text that contain amphipod starting positions, insert the following lines:
#D#C#B#A#
#D#B#A#C#
So, the above example now becomes:
#############
#...........#
###B#C#B#D###
#D#C#B#A#
#D#B#A#C#
#A#D#C#A#
#########
The amphipods still want to be organized into rooms similar to before:
#############
#...........#
###A#B#C#D###
#A#B#C#D#
#A#B#C#D#
#A#B#C#D#
#########
In this updated example, the least energy required to organize these amphipods is 44169:
#############
#...........#
###B#C#B#D###
#D#C#B#A#
#D#B#A#C#
#A#D#C#A#
#########
#############
#..........D#
###B#C#B#.###
#D#C#B#A#
#D#B#A#C#
#A#D#C#A#
#########
#############
#A.........D#
###B#C#B#.###
#D#C#B#.#
#D#B#A#C#
#A#D#C#A#
#########
#############
#A........BD#
###B#C#.#.###
#D#C#B#.#
#D#B#A#C#
#A#D#C#A#
#########
#############
#A......B.BD#
###B#C#.#.###
#D#C#.#.#
#D#B#A#C#
#A#D#C#A#
#########
#############
#AA.....B.BD#
###B#C#.#.###
#D#C#.#.#
#D#B#.#C#
#A#D#C#A#
#########
#############
#AA.....B.BD#
###B#.#.#.###
#D#C#.#.#
#D#B#C#C#
#A#D#C#A#
#########
#############
#AA.....B.BD#
###B#.#.#.###
#D#.#C#.#
#D#B#C#C#
#A#D#C#A#
#########
#############
#AA...B.B.BD#
###B#.#.#.###
#D#.#C#.#
#D#.#C#C#
#A#D#C#A#
#########
#############
#AA.D.B.B.BD#
###B#.#.#.###
#D#.#C#.#
#D#.#C#C#
#A#.#C#A#
#########
#############
#AA.D...B.BD#
###B#.#.#.###
#D#.#C#.#
#D#.#C#C#
#A#B#C#A#
#########
#############
#AA.D.....BD#
###B#.#.#.###
#D#.#C#.#
#D#B#C#C#
#A#B#C#A#
#########
#############
#AA.D......D#
###B#.#.#.###
#D#B#C#.#
#D#B#C#C#
#A#B#C#A#
#########
#############
#AA.D......D#
###B#.#C#.###
#D#B#C#.#
#D#B#C#.#
#A#B#C#A#
#########
#############
#AA.D.....AD#
###B#.#C#.###
#D#B#C#.#
#D#B#C#.#
#A#B#C#.#
#########
#############
#AA.......AD#
###B#.#C#.###
#D#B#C#.#
#D#B#C#.#
#A#B#C#D#
#########
#############
#AA.......AD#
###.#B#C#.###
#D#B#C#.#
#D#B#C#.#
#A#B#C#D#
#########
#############
#AA.......AD#
###.#B#C#.###
#.#B#C#.#
#D#B#C#D#
#A#B#C#D#
#########
#############
#AA.D.....AD#
###.#B#C#.###
#.#B#C#.#
#.#B#C#D#
#A#B#C#D#
#########
#############
#A..D.....AD#
###.#B#C#.###
#.#B#C#.#
#A#B#C#D#
#A#B#C#D#
#########
#############
#...D.....AD#
###.#B#C#.###
#A#B#C#.#
#A#B#C#D#
#A#B#C#D#
#########
#############
#.........AD#
###.#B#C#.###
#A#B#C#D#
#A#B#C#D#
#A#B#C#D#
#########
#############
#..........D#
###A#B#C#.###
#A#B#C#D#
#A#B#C#D#
#A#B#C#D#
#########
#############
#...........#
###A#B#C#D###
#A#B#C#D#
#A#B#C#D#
#A#B#C#D#
#########
Using the initial configuration from the full diagram, what is the least energy required to organize the amphipods?