aoc2018-0.1.0.0: Advent of Code 2018 solutions and auto-runner

Copyright(c) Justin Le 2018
LicenseBSD3
Maintainerjustin@jle.im
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

AOC.Challenge.Day02

Description

Day 2. See AOC.Solver for the types used in this module!

Synopsis

Documentation

day02a :: [String] :~> Int Source #

We compute a frequency map of all of the characters in a string, and then get all of the frequencies that happened for each line.

Then we build a frequency map of the frequencies!

day02b :: [String] :~> String Source #

The main work is in firstNeighbor, which looks thorugh a list of items and finds the first item whose neighbor was already seen.

Then we take the two "almost matching" strings and filter out all of the characters that aren't the same, using zipWith and catMaybes.