adventofcode-0.1.0.0: Haskell solutions to adventofcode
LicenseMIT
Maintainer@tylerjl
Safe HaskellSafe-Inferred
LanguageHaskell2010

Y2023.D02

Description

Solutions to the 2023 day 02 set of problems for adventofcode.com.

Synopsis

Documentation

data Color #

Constructors

Red 
Green 
Blue 

Instances

Instances details
Show Color # 
Instance details

Defined in Y2023.D02

Eq Color # 
Instance details

Defined in Y2023.D02

Methods

(==) :: Color -> Color -> Bool Source #

(/=) :: Color -> Color -> Bool Source #

Ord Color # 
Instance details

Defined in Y2023.D02

type Bag = Map Color Int #

type Games = IntMap Bag #

part2A :: Text -> Int #

Solve for part A

maxColors :: [(Color, Int)] -> Bag -> Bool #

Take a list of color and shown time and determine whether the bag meets the criteria.

part2B :: Text -> Int #

Solve for part B

maxColor :: Color -> Int -> Bag -> Bool #

parseRounds :: Text -> Games #

Parse the Game structure from an input Text.

parseGames :: Parser Games #

parseGame :: Parser (Int, Bag) #

parseBags :: Parser Bag #

parseBag :: Parser Bag #

parseColorCount :: Parser (Color, Int) #

parseColor :: Parser Color #