Wovi10 / AdventOfCodeCollection

Collection of Advent Of Code years
0 stars 0 forks source link

11_Cosmic_Expansion_02 #29

Closed Wovi10 closed 6 months ago

Wovi10 commented 7 months ago

--- Part Two --- The galaxies are much older (and thus much farther apart) than the researcher initially estimated.

Now, instead of the expansion you did before, make each empty row or column one million times larger. That is, each empty row should be replaced with 1000000 empty rows, and each empty column should be replaced with 1000000 empty columns.

(In the example above, if each empty row or column were merely 10 times larger, the sum of the shortest paths between every pair of galaxies would be 1030. If each empty row or column were merely 100 times larger, the sum of the shortest paths between every pair of galaxies would be 8410. However, your universe will need to expand far beyond these values.)

Starting with the same initial image, expand the universe according to these new rules, then find the length of the shortest path between every pair of galaxies. What is the sum of these lengths?

Wovi10 commented 6 months ago

Answer = 377318892554