diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-04-07 17:18:18 -0400 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-04-07 17:19:39 -0400 |
| commit | 87ab487d59fa85dbe2afa55cc841b02805ae42ca (patch) | |
| tree | cd90ab715e1b5b5803674045dbafd6d51d27ac90 /src/06/part2 | |
| parent | 1bcc82c5bfbde87edd03c01ffdf9ee5934681592 (diff) | |
| download | aoc2018-python-87ab487d59fa85dbe2afa55cc841b02805ae42ca.tar.gz aoc2018-python-87ab487d59fa85dbe2afa55cc841b02805ae42ca.zip | |
Reorder days into src
Diffstat (limited to 'src/06/part2')
| -rw-r--r-- | src/06/part2 | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/06/part2 b/src/06/part2 new file mode 100644 index 0000000..1088955 --- /dev/null +++ b/src/06/part2 @@ -0,0 +1,61 @@ +--- Part Two --- + +Now, you just need to figure out how many [1m[97morbital transfers[0m you (YOU) need to take to get to Santa +(SAN). + +You start at the object YOU are orbiting; your destination is the object SAN is orbiting. An orbital +transfer lets you move from any object to an object orbiting or orbited by that object. + +For example, suppose you have the following map: + +COM)B +B)C +C)D +D)E +E)F +B)G +G)H +D)I +E)J +J)K +K)L +K)YOU +I)SAN + +Visually, the above map of orbits looks like this: + + [1m[97mYOU[0m + [1m[97m/[0m + G - H [1m[97mJ - K[0m - L + / [1m[97m/[0m +COM - B - C - [1m[97mD - E[0m - F + [1m[97m\[0m + [1m[97mI - SAN[0m + +In this example, YOU are in orbit around K, and SAN is in orbit around I. To move from K to I, a +minimum of 4 orbital transfers are required: + + + - K to J + + - J to E + + - E to D + + - D to I + + +Afterward, the map of orbits looks like this: + + G - H J - K - L + / / +COM - B - C - D - E - F + \ + I - SAN + [1m[97m\[0m + [1m[97mYOU[0m + +[1m[97mWhat is the minimum number of orbital transfers required[0m to move from the object YOU are orbiting to +the object SAN is orbiting? (Between the objects they are orbiting - [1m[97mnot[0m between YOU and SAN.) + + |
