Copyright | (c) Eric Mertens 2018 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
https://adventofcode.com/2018/day/11
This solution uses dynamic programming to efficiently compute the area of an arbitrary square on the power-cell grid.
This efficiency is achieved using a summed-area table. https://en.wikipedia.org/wiki/Summed-area_table
Once we've computed this table we're able compute the sum of the elements contained in an arbitrary rectangle via addition and subtraction of 4 elements.