Man this one frustrated me because of a subtle difference in the wording of part 1 vs part 2. I had the correct logic from the start, but with an off-by-one error because of my interpretation of the wording. Part 1 says, "any rows or columns that contain no galaxies should all actually be twice as big" while part 2 says, "each empty column should be replaced with 1000000
empty columns".
I added 1 column/row in part 1
, and 1_000_000
in part 2. But if you're replacing an empty column with 1_000_000
, you're actually adding 999_999
columns. It took me a good hour to discover where that off-by-one error was coming from.