sln_2023_11
Copyright(c) Eric Mertens 2023
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2023/day/11

We're given a map of galaxies and need to find the sum of all distances between the pairs of galaxies. The twist is that empty rows and columns are expanded.

We can simplify this problem by solving the X and Y axes separately. We can collapse the input down to a count of how many galaxies exist at each location on a single axis.

>>> :{
:main +
"...#......
.......#..
#.........
..........
......#...
.#........
.........#
..........
.......#..
#...#.....
"
:}
374
82000210
Synopsis

Documentation

main :: IO () Source #

Parse the input map and print out the answers to both parts.

>>> :main
9965032
550358864332