sln_2021_22
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2021/day/22

This solution processes commands in order and tracks the currently lit regions with a list of disjoint cubes. When processing a new cube, the cube is deleted from the list of lit cubes and then added back in as a whole cube if the command would turn lights on.

A slower, but also popular solution using the Inclusion-Exclusion Principle can be found in solveInEx.

https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle

Synopsis

Documentation

main :: IO () Source #

>>> :main
606484
1162571910364852