Done day 7
authorNeil Smith <neil.git@njae.me.uk>
Sat, 12 Dec 2020 16:39:21 +0000 (16:39 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Sat, 12 Dec 2020 16:39:21 +0000 (16:39 +0000)
advent06/src/advent06.hs
advent07/package.yaml [new file with mode: 0644]
advent07/src/advent07.hs [new file with mode: 0644]
data/advent07.txt [new file with mode: 0644]
data/advent07a.txt [new file with mode: 0644]
data/advent07b.txt [new file with mode: 0644]
problems/day07.html [new file with mode: 0644]
problems/day4.html [deleted file]
stack.yaml

index 9e8050108bacf47f1bae570044f78b23cf68d7a3..2f94908111d33f9136de9d6bdf87b94cf5e43467 100644 (file)
@@ -30,9 +30,9 @@ blankLines = skipMany1 endOfLine
 personP = S.fromList <$> many1 letter
 groupP = sepBy1 personP endOfLine
 
 personP = S.fromList <$> many1 letter
 groupP = sepBy1 personP endOfLine
 
-groupsP = sepBy1 groupP blankLines
+groupsP = sepBy groupP blankLines
 
 
--- successfulParse :: Text -> [Passport]
+successfulParse :: Text -> [[S.Set Char]]
 successfulParse input = 
   case parseOnly groupsP input of
     Left  _err -> [] -- TIO.putStr $ T.pack $ parseErrorPretty err
 successfulParse input = 
   case parseOnly groupsP input of
     Left  _err -> [] -- TIO.putStr $ T.pack $ parseErrorPretty err
diff --git a/advent07/package.yaml b/advent07/package.yaml
new file mode 100644 (file)
index 0000000..88422cf
--- /dev/null
@@ -0,0 +1,61 @@
+# This YAML file describes your package. Stack will automatically generate a
+# Cabal file when you run `stack build`. See the hpack website for help with
+# this file: <https://github.com/sol/hpack>.
+
+name: advent07
+synopsis: Advent of Code
+version: '0.0.1'
+
+default-extensions:
+- AllowAmbiguousTypes
+- ApplicativeDo
+- BangPatterns
+- BlockArguments
+- DataKinds
+- DeriveFoldable
+- DeriveFunctor
+- DeriveGeneric
+- DeriveTraversable
+- EmptyCase
+- FlexibleContexts
+- FlexibleInstances
+- FunctionalDependencies
+- GADTs
+- GeneralizedNewtypeDeriving
+- ImplicitParams
+- KindSignatures
+- LambdaCase
+- MonadComprehensions
+- MonoLocalBinds
+- MultiParamTypeClasses
+- MultiWayIf
+- NamedFieldPuns
+- NegativeLiterals
+- NumDecimals
+# - OverloadedLists
+- OverloadedStrings
+- PartialTypeSignatures
+- PatternGuards
+- PatternSynonyms
+- PolyKinds
+- RankNTypes
+- RecordWildCards
+- ScopedTypeVariables
+- TemplateHaskell
+- TransformListComp
+- TupleSections
+- TypeApplications
+- TypeFamilies
+- TypeInType
+- TypeOperators
+- ViewPatterns
+
+executables:
+  advent07:
+    main: advent07.hs
+    source-dirs: src
+    dependencies:
+    - base >= 2 && < 6
+    - text
+    - attoparsec
+    - containers
\ No newline at end of file
diff --git a/advent07/src/advent07.hs b/advent07/src/advent07.hs
new file mode 100644 (file)
index 0000000..ee7a514
--- /dev/null
@@ -0,0 +1,87 @@
+-- import Debug.Trace
+
+import Data.Text (Text)
+import qualified Data.Text as T
+import qualified Data.Text.IO as TIO
+
+import Data.Attoparsec.Text
+-- import Data.Attoparsec.Combinator
+import Control.Applicative
+
+import qualified Data.Set as S
+import qualified Data.Map.Strict as M
+import Data.Map.Strict ((!))
+
+import Data.Maybe
+
+data QuantifiedBag = QuantifiedBag Integer String
+    deriving (Show, Eq, Ord)
+
+
+main :: IO ()
+main = 
+  do  text <- TIO.readFile "data/advent07.txt"
+      let bags = successfulParse text
+      -- print bags
+      -- print $ invertBags bags
+      print $ part1 bags
+      print $ part2 bags
+
+part1 bags = S.size $ S.delete "shiny gold" containers
+    where containers = bagsContaining (invertBags bags) (S.singleton "shiny gold") S.empty
+
+part2 bags = (nContainedBags bags "shiny gold") - 1
+
+invertBags bags = foldr addInvert M.empty $ concatMap swapPair $ M.assocs bags 
+    where swapPair (a, bs) = [(qName b, a) | b <- S.toList bs]
+
+addInvert :: (String, String) -> (M.Map String (S.Set String)) -> (M.Map String (S.Set String))
+addInvert (k, v) m = 
+    if k `M.member` m
+    then M.insert k v' m
+    else M.insert k (S.singleton v) m
+    where v' = S.insert v (m!k)
+
+qName (QuantifiedBag _ n) = n
+qCount (QuantifiedBag n _) = n
+
+bagsContaining :: (M.Map String (S.Set String)) -> (S.Set String) -> (S.Set String) -> (S.Set String)
+bagsContaining iBags agenda result 
+    | S.null agenda = result
+    | otherwise = bagsContaining iBags agenda'' (S.insert thisColour result)
+    where thisColour = S.findMin agenda
+          agenda' = S.delete thisColour agenda
+          agenda'' = if thisColour `S.member` result
+                     then agenda'
+                     else S.union (fromMaybe S.empty (M.lookup thisColour iBags)) agenda' 
+
+nContainedBags :: (M.Map String (S.Set QuantifiedBag)) -> String -> Integer
+nContainedBags bags thisBag = 1 + (sum $ map subCount others)
+    where others = S.toList $ bags!thisBag
+          subCount b = (qCount b) * (nContainedBags bags (qName b))
+
+
+
+-- -- Parse the input file
+
+bagNameP = manyTill anyChar ((string " bags") <|> (string " bag"))
+
+quantifiedBagP = QuantifiedBag <$> decimal <* space <*> bagNameP
+
+emptyBagListP = "no other bags" *> pure S.empty
+
+bagListP = S.fromList <$> sepBy quantifiedBagP (string ", ")
+
+bagContentsP = emptyBagListP <|> bagListP
+
+ruleP = (,) <$> bagNameP <* " contain " <*> bagContentsP <* "."
+
+rulesP = M.fromList <$> sepBy ruleP endOfLine
+
+
+
+-- successfulParse :: Text -> [[S.Set Char]]
+successfulParse input = 
+  case parseOnly rulesP input of
+    Left  _err -> M.empty -- TIO.putStr $ T.pack $ parseErrorPretty err
+    Right bags -> bags
diff --git a/data/advent07.txt b/data/advent07.txt
new file mode 100644 (file)
index 0000000..b75a024
--- /dev/null
@@ -0,0 +1,594 @@
+muted white bags contain 4 dark orange bags, 3 bright white bags.
+bright salmon bags contain 5 light indigo bags.
+drab brown bags contain 2 dark green bags, 2 plaid fuchsia bags, 1 muted tomato bag, 5 light tan bags.
+dark salmon bags contain 1 posh white bag, 4 light violet bags.
+mirrored gray bags contain 4 mirrored turquoise bags.
+posh turquoise bags contain 3 mirrored magenta bags, 1 muted red bag, 4 dim gray bags, 5 dull tan bags.
+posh coral bags contain 4 dark purple bags, 5 drab teal bags.
+light violet bags contain 2 striped magenta bags, 5 light lime bags, 5 posh cyan bags.
+dull brown bags contain 1 vibrant silver bag, 3 dotted beige bags.
+dim salmon bags contain no other bags.
+light bronze bags contain 1 bright maroon bag, 3 faded olive bags, 2 shiny beige bags, 4 striped orange bags.
+pale plum bags contain 3 muted white bags, 3 striped magenta bags.
+shiny tomato bags contain 4 vibrant chartreuse bags.
+dark gray bags contain 5 dim bronze bags.
+plaid tan bags contain 4 light coral bags, 2 dim fuchsia bags, 3 mirrored coral bags.
+bright blue bags contain 4 muted gold bags, 4 striped aqua bags.
+faded cyan bags contain 4 drab teal bags, 2 faded black bags, 1 posh cyan bag.
+clear purple bags contain 4 posh lavender bags, 4 dim green bags, 2 dull white bags, 5 pale crimson bags.
+faded chartreuse bags contain 2 wavy orange bags, 5 vibrant red bags, 5 pale salmon bags, 2 vibrant plum bags.
+dull plum bags contain 2 posh gray bags, 1 bright aqua bag, 3 faded lavender bags, 3 dull salmon bags.
+dull magenta bags contain 3 shiny violet bags, 2 posh tan bags.
+pale lime bags contain 2 vibrant plum bags, 5 striped crimson bags.
+shiny cyan bags contain 5 plaid black bags, 4 muted lime bags, 3 posh black bags.
+posh lime bags contain 5 light lavender bags, 1 dim green bag, 3 dull purple bags, 5 muted tomato bags.
+dotted tomato bags contain 2 bright lavender bags, 5 muted white bags, 5 pale maroon bags, 4 dotted tan bags.
+muted teal bags contain 5 shiny brown bags, 1 drab olive bag, 2 shiny black bags, 3 posh white bags.
+mirrored violet bags contain 1 striped gold bag, 4 drab lavender bags, 4 mirrored blue bags, 4 bright gold bags.
+dim crimson bags contain 1 pale bronze bag, 2 pale turquoise bags, 5 striped aqua bags, 1 light lavender bag.
+wavy chartreuse bags contain 2 shiny violet bags, 2 striped white bags, 1 vibrant silver bag.
+mirrored red bags contain 3 clear maroon bags, 4 dim indigo bags, 5 drab brown bags, 1 shiny white bag.
+mirrored maroon bags contain 4 drab maroon bags, 1 mirrored teal bag, 5 faded coral bags.
+clear teal bags contain 4 dim orange bags, 4 mirrored bronze bags, 3 faded beige bags.
+muted lime bags contain 4 faded indigo bags, 2 muted olive bags, 2 mirrored chartreuse bags.
+faded fuchsia bags contain 5 dim bronze bags, 3 muted tan bags, 3 drab teal bags, 5 faded bronze bags.
+dull blue bags contain 5 shiny beige bags, 2 shiny silver bags, 5 dull fuchsia bags.
+drab white bags contain 1 dotted aqua bag.
+dark chartreuse bags contain 2 mirrored magenta bags, 3 wavy yellow bags.
+bright gold bags contain 4 faded fuchsia bags, 1 plaid olive bag, 5 muted tomato bags, 4 drab bronze bags.
+drab chartreuse bags contain 1 vibrant lime bag, 2 dark teal bags.
+muted plum bags contain 5 light yellow bags, 4 drab lime bags.
+shiny lime bags contain 4 dull brown bags, 5 dark brown bags.
+pale white bags contain 2 dull aqua bags, 5 muted tan bags, 1 drab bronze bag.
+dim violet bags contain 1 wavy red bag, 2 striped brown bags.
+posh gold bags contain 4 wavy blue bags, 3 dotted aqua bags, 5 wavy maroon bags, 5 striped indigo bags.
+light indigo bags contain 3 striped teal bags, 2 wavy blue bags, 5 shiny brown bags, 3 plaid fuchsia bags.
+posh tan bags contain 4 bright aqua bags, 5 clear gold bags.
+muted bronze bags contain 4 drab fuchsia bags, 3 bright brown bags, 2 dull brown bags, 3 plaid red bags.
+shiny turquoise bags contain 2 muted purple bags, 2 striped green bags, 1 clear tomato bag, 5 bright plum bags.
+pale tan bags contain 4 dark brown bags, 1 clear tomato bag, 1 mirrored black bag, 4 bright red bags.
+faded yellow bags contain 3 drab purple bags.
+striped black bags contain 1 clear lavender bag.
+dotted indigo bags contain 4 striped plum bags.
+dull black bags contain 5 posh crimson bags, 5 shiny bronze bags, 5 posh salmon bags, 4 bright salmon bags.
+plaid beige bags contain 3 drab turquoise bags, 4 striped lavender bags.
+striped gray bags contain 5 vibrant bronze bags, 4 bright chartreuse bags.
+wavy bronze bags contain 2 clear teal bags, 2 light orange bags, 1 striped beige bag.
+mirrored green bags contain 5 plaid lavender bags, 2 mirrored purple bags, 1 dark silver bag.
+posh maroon bags contain 2 faded blue bags, 5 light tan bags, 4 clear brown bags.
+plaid chartreuse bags contain 2 posh white bags, 3 striped orange bags, 5 light beige bags, 3 drab lime bags.
+muted tomato bags contain 3 striped teal bags.
+drab magenta bags contain 3 bright brown bags, 2 muted white bags, 4 shiny silver bags, 1 shiny indigo bag.
+light gray bags contain 3 striped turquoise bags, 1 light purple bag.
+pale violet bags contain 3 posh olive bags, 2 drab green bags.
+light chartreuse bags contain 2 dull silver bags, 5 faded maroon bags, 5 drab purple bags, 5 shiny gold bags.
+dull gold bags contain 2 shiny indigo bags, 5 bright orange bags, 4 faded bronze bags, 1 shiny tan bag.
+dark black bags contain 1 faded lavender bag, 1 faded gold bag, 5 clear blue bags.
+clear blue bags contain 3 dull teal bags, 3 wavy violet bags.
+vibrant violet bags contain 3 dark purple bags, 3 bright aqua bags, 2 light indigo bags, 2 vibrant lime bags.
+pale gray bags contain 3 plaid green bags, 2 dull beige bags.
+plaid teal bags contain 1 wavy gold bag.
+dotted maroon bags contain 2 shiny green bags, 5 wavy magenta bags, 5 posh fuchsia bags.
+pale coral bags contain 1 plaid chartreuse bag, 1 dark bronze bag, 3 wavy blue bags.
+shiny plum bags contain 2 dark yellow bags, 2 plaid gold bags.
+light plum bags contain 2 light olive bags, 1 clear yellow bag.
+drab aqua bags contain 4 wavy gray bags, 5 bright beige bags, 1 drab plum bag, 2 posh coral bags.
+posh brown bags contain 4 dim blue bags, 3 shiny tan bags.
+pale tomato bags contain 4 light olive bags, 2 shiny olive bags, 3 posh lavender bags.
+dim orange bags contain 3 posh tan bags.
+dull olive bags contain 5 dim turquoise bags, 3 dotted blue bags, 1 dotted plum bag, 5 mirrored bronze bags.
+dim gray bags contain 3 shiny blue bags, 3 striped aqua bags, 2 bright tomato bags.
+posh gray bags contain 1 plaid crimson bag, 1 mirrored yellow bag.
+wavy silver bags contain 5 mirrored black bags, 5 clear gray bags.
+muted salmon bags contain 1 clear indigo bag.
+clear gold bags contain no other bags.
+dotted cyan bags contain 2 dotted turquoise bags.
+light crimson bags contain 2 shiny turquoise bags, 3 plaid fuchsia bags, 2 shiny yellow bags.
+plaid lime bags contain 1 dim silver bag.
+dim beige bags contain 3 clear green bags, 3 mirrored gray bags, 4 dotted lavender bags, 5 muted bronze bags.
+dark coral bags contain 4 bright tomato bags, 3 shiny brown bags, 3 light magenta bags.
+dull orange bags contain 5 striped red bags, 3 pale coral bags, 5 vibrant green bags, 5 muted indigo bags.
+vibrant gold bags contain 4 dull crimson bags, 2 dark yellow bags.
+mirrored coral bags contain 2 bright green bags, 3 shiny orange bags, 3 clear aqua bags, 3 dull salmon bags.
+pale purple bags contain 2 bright tomato bags, 3 light beige bags, 5 plaid bronze bags, 4 dull beige bags.
+bright olive bags contain 1 shiny beige bag, 3 mirrored crimson bags, 5 striped orange bags, 3 plaid fuchsia bags.
+clear black bags contain 2 dull green bags.
+bright red bags contain 5 posh cyan bags, 1 clear black bag, 2 plaid turquoise bags, 4 muted yellow bags.
+mirrored tan bags contain 3 light cyan bags, 2 vibrant red bags.
+muted orange bags contain 1 clear lavender bag, 4 posh bronze bags, 3 dim bronze bags.
+plaid orange bags contain 3 shiny silver bags.
+shiny teal bags contain 4 light chartreuse bags, 2 dull crimson bags.
+striped crimson bags contain 2 dotted tomato bags, 5 dim fuchsia bags.
+dotted tan bags contain 3 drab purple bags, 2 mirrored bronze bags, 3 shiny beige bags, 3 posh tan bags.
+posh olive bags contain 1 clear tomato bag.
+faded silver bags contain 4 drab blue bags, 5 dull yellow bags, 4 dim red bags.
+plaid violet bags contain 3 dull tan bags, 1 dim yellow bag.
+muted violet bags contain 4 clear violet bags, 2 mirrored teal bags, 1 plaid violet bag.
+dull lavender bags contain 2 dotted silver bags, 4 striped coral bags, 5 striped indigo bags.
+faded crimson bags contain 2 drab red bags.
+striped coral bags contain 5 dull brown bags, 3 vibrant red bags.
+shiny tan bags contain 1 shiny fuchsia bag, 2 plaid gray bags.
+plaid coral bags contain 4 muted brown bags, 3 faded indigo bags, 5 wavy white bags, 3 mirrored blue bags.
+bright white bags contain no other bags.
+dark green bags contain 2 mirrored lime bags, 4 wavy maroon bags.
+mirrored yellow bags contain 3 posh white bags.
+bright magenta bags contain 1 drab lime bag, 4 mirrored black bags, 4 dark yellow bags, 1 light indigo bag.
+shiny aqua bags contain 4 drab tan bags, 3 muted gray bags.
+dim olive bags contain 4 dotted lavender bags, 4 plaid green bags, 1 posh lavender bag, 5 dim tan bags.
+posh magenta bags contain 3 posh white bags, 1 clear plum bag.
+light aqua bags contain 4 dim salmon bags.
+muted indigo bags contain 5 plaid purple bags.
+clear chartreuse bags contain 2 mirrored bronze bags.
+dim teal bags contain 4 striped orange bags, 4 posh tan bags, 2 wavy maroon bags, 3 bright turquoise bags.
+dim lime bags contain 5 faded coral bags, 2 muted aqua bags, 4 faded maroon bags, 3 mirrored bronze bags.
+faded black bags contain 1 wavy maroon bag, 1 light aqua bag, 2 muted gray bags.
+striped violet bags contain 3 drab olive bags, 3 clear purple bags.
+plaid silver bags contain 4 wavy violet bags, 4 dotted beige bags, 4 dull bronze bags.
+dull salmon bags contain 4 light bronze bags, 1 drab fuchsia bag.
+posh salmon bags contain 4 dim bronze bags.
+dim plum bags contain 4 pale maroon bags, 2 dim yellow bags, 4 dim turquoise bags.
+faded maroon bags contain 1 shiny blue bag, 4 striped lavender bags, 2 bright aqua bags, 4 posh white bags.
+plaid white bags contain 1 dark coral bag, 4 drab salmon bags, 5 muted blue bags.
+pale red bags contain 3 dim aqua bags, 3 shiny lavender bags.
+plaid gold bags contain 3 dotted brown bags, 5 clear tomato bags.
+dim white bags contain 4 bright olive bags, 4 vibrant maroon bags, 5 pale brown bags.
+bright brown bags contain 3 dark green bags, 3 dim gold bags, 2 bright aqua bags, 2 pale indigo bags.
+mirrored bronze bags contain 5 striped orange bags, 1 dim bronze bag, 2 clear gold bags.
+plaid plum bags contain 3 dotted tan bags, 5 dim salmon bags.
+dim maroon bags contain 5 light aqua bags.
+striped brown bags contain 3 vibrant beige bags, 2 dim indigo bags.
+vibrant yellow bags contain 2 plaid black bags.
+shiny white bags contain 2 dim maroon bags, 1 posh lavender bag, 5 dim gray bags.
+striped tomato bags contain 2 pale plum bags, 2 wavy lime bags, 3 dim lime bags, 5 dark teal bags.
+drab tan bags contain 5 dark brown bags.
+pale beige bags contain 4 dim teal bags, 3 dim silver bags.
+faded aqua bags contain 1 muted black bag, 1 light bronze bag.
+dim green bags contain 3 vibrant lime bags, 2 drab fuchsia bags.
+dim lavender bags contain 3 dotted beige bags, 1 dim green bag, 1 faded coral bag, 1 shiny teal bag.
+pale blue bags contain 4 plaid fuchsia bags, 2 dark purple bags, 5 bright crimson bags.
+faded lavender bags contain 1 mirrored black bag, 4 muted blue bags.
+plaid aqua bags contain 2 clear maroon bags, 4 shiny teal bags, 2 posh fuchsia bags.
+dotted violet bags contain 2 pale indigo bags, 2 muted red bags, 3 light lavender bags, 3 shiny yellow bags.
+dotted olive bags contain 4 dim aqua bags, 5 striped maroon bags, 1 pale red bag.
+drab lime bags contain 3 dotted aqua bags, 4 posh tan bags, 2 faded black bags.
+dim yellow bags contain 2 faded maroon bags, 5 light teal bags.
+dull maroon bags contain 5 drab purple bags, 1 pale maroon bag, 2 light gold bags, 1 faded salmon bag.
+wavy tan bags contain 2 vibrant maroon bags, 3 muted white bags, 2 shiny brown bags, 4 light chartreuse bags.
+dull violet bags contain 4 bright beige bags, 2 vibrant maroon bags, 5 dim gold bags, 4 drab violet bags.
+drab cyan bags contain 1 light olive bag, 3 dark turquoise bags, 3 dark yellow bags, 2 light black bags.
+wavy coral bags contain 3 posh lavender bags, 2 pale indigo bags, 2 striped green bags, 5 light beige bags.
+clear white bags contain 5 dull purple bags, 2 wavy red bags.
+shiny gray bags contain 3 striped teal bags.
+shiny indigo bags contain 4 clear gold bags, 3 dark teal bags.
+light blue bags contain 1 muted coral bag, 5 dark cyan bags.
+bright cyan bags contain 5 drab brown bags, 1 pale teal bag, 2 posh cyan bags, 5 shiny indigo bags.
+plaid yellow bags contain 1 vibrant gray bag.
+dotted brown bags contain 3 mirrored silver bags.
+dotted bronze bags contain 1 light indigo bag, 5 mirrored crimson bags.
+bright purple bags contain 3 posh teal bags, 3 dim orange bags, 4 dark gold bags, 1 striped purple bag.
+striped lavender bags contain 5 dim salmon bags, 2 posh indigo bags.
+dark gold bags contain 5 faded brown bags, 1 faded magenta bag, 4 drab lavender bags, 1 dull tan bag.
+clear beige bags contain 3 drab violet bags, 2 dim crimson bags.
+drab orange bags contain 1 clear blue bag.
+wavy teal bags contain 4 plaid green bags, 5 light bronze bags, 5 shiny indigo bags, 4 drab violet bags.
+muted maroon bags contain 1 bright plum bag, 1 dim teal bag.
+wavy violet bags contain 2 striped green bags, 5 striped brown bags, 4 muted bronze bags.
+clear brown bags contain 2 wavy lime bags, 2 mirrored red bags.
+plaid magenta bags contain 3 vibrant gold bags, 2 striped green bags, 4 striped maroon bags.
+vibrant blue bags contain 2 light beige bags, 5 mirrored cyan bags, 4 dark blue bags, 5 drab yellow bags.
+mirrored brown bags contain 2 dotted white bags.
+light gold bags contain 3 vibrant silver bags.
+mirrored silver bags contain 4 faded maroon bags, 5 faded coral bags.
+bright indigo bags contain 1 clear salmon bag, 4 dim turquoise bags, 2 mirrored black bags, 1 striped indigo bag.
+mirrored olive bags contain 2 drab olive bags, 4 vibrant gray bags.
+dark silver bags contain 4 bright chartreuse bags, 1 shiny indigo bag, 2 dull brown bags.
+drab salmon bags contain 3 dotted plum bags, 2 bright gold bags, 2 plaid beige bags.
+dotted white bags contain 3 bright plum bags, 5 dotted beige bags, 1 dotted silver bag.
+light olive bags contain 1 muted aqua bag, 2 striped brown bags, 1 mirrored bronze bag.
+dotted blue bags contain 3 drab red bags, 2 mirrored bronze bags.
+muted lavender bags contain 4 clear chartreuse bags, 4 striped brown bags, 3 mirrored tan bags, 5 shiny indigo bags.
+dotted chartreuse bags contain 3 clear maroon bags, 5 clear turquoise bags, 4 mirrored aqua bags, 5 plaid aqua bags.
+posh crimson bags contain 5 plaid plum bags, 1 wavy blue bag.
+vibrant olive bags contain 3 wavy silver bags, 1 shiny blue bag.
+wavy yellow bags contain 3 dim teal bags, 1 light brown bag, 4 dull chartreuse bags, 5 striped red bags.
+dark olive bags contain 5 bright maroon bags, 4 dim tan bags, 3 bright aqua bags, 2 pale turquoise bags.
+bright plum bags contain 1 light yellow bag, 4 muted aqua bags.
+drab plum bags contain 1 dim gray bag, 5 light chartreuse bags.
+striped salmon bags contain 4 drab lavender bags.
+bright coral bags contain 4 clear tomato bags.
+drab silver bags contain 2 shiny orange bags, 2 muted coral bags.
+posh violet bags contain 3 wavy red bags, 3 shiny blue bags, 4 pale brown bags, 1 light yellow bag.
+mirrored black bags contain 3 wavy white bags, 4 dotted tan bags, 3 shiny purple bags, 3 dim bronze bags.
+faded green bags contain 2 drab brown bags.
+posh yellow bags contain 3 striped gold bags, 4 light purple bags.
+drab lavender bags contain 5 pale brown bags, 4 striped aqua bags.
+clear magenta bags contain 4 dull beige bags, 2 wavy red bags.
+wavy fuchsia bags contain 4 dull fuchsia bags, 1 bright beige bag.
+bright maroon bags contain 2 striped orange bags, 2 muted white bags, 4 vibrant beige bags.
+mirrored chartreuse bags contain 2 bright plum bags.
+mirrored lavender bags contain 4 clear magenta bags.
+light lime bags contain 4 vibrant cyan bags, 2 mirrored yellow bags, 5 light teal bags, 4 muted plum bags.
+pale green bags contain 3 vibrant coral bags.
+dark plum bags contain 3 shiny lavender bags, 1 light plum bag, 5 drab gold bags.
+faded purple bags contain 2 wavy lime bags, 5 drab teal bags, 1 dark green bag.
+dim silver bags contain 5 striped white bags, 5 drab coral bags.
+faded bronze bags contain 1 bright white bag, 5 posh fuchsia bags, 2 mirrored teal bags.
+pale indigo bags contain 1 dull brown bag, 4 muted red bags, 3 vibrant chartreuse bags, 5 drab teal bags.
+dark tan bags contain 2 dim blue bags, 3 plaid indigo bags, 1 vibrant indigo bag, 5 dull salmon bags.
+bright silver bags contain 4 vibrant black bags, 5 clear salmon bags, 5 dull violet bags.
+striped aqua bags contain 1 pale brown bag, 5 shiny silver bags, 1 dim salmon bag, 3 dull chartreuse bags.
+light beige bags contain 1 posh lavender bag, 2 muted gold bags, 5 light tan bags, 5 striped magenta bags.
+faded gold bags contain 1 posh brown bag, 5 dull salmon bags, 5 faded olive bags, 2 posh coral bags.
+drab violet bags contain 3 vibrant gray bags, 1 light silver bag, 5 posh gold bags, 1 vibrant lime bag.
+striped beige bags contain 5 shiny yellow bags, 5 striped magenta bags, 1 shiny gold bag, 2 dotted tan bags.
+muted beige bags contain 4 wavy lavender bags, 2 light beige bags, 4 vibrant tan bags, 5 dark plum bags.
+shiny salmon bags contain 4 muted aqua bags, 3 dark olive bags, 5 shiny blue bags, 3 wavy maroon bags.
+dotted crimson bags contain 5 mirrored cyan bags, 2 light black bags, 2 faded lavender bags, 3 drab indigo bags.
+vibrant red bags contain 3 light silver bags, 1 shiny purple bag, 1 shiny blue bag, 4 dotted lavender bags.
+striped yellow bags contain 4 clear red bags, 2 dim violet bags.
+posh bronze bags contain 3 clear salmon bags, 1 dull salmon bag, 3 drab turquoise bags.
+mirrored plum bags contain 1 bright plum bag, 5 striped tan bags, 4 shiny magenta bags, 1 shiny coral bag.
+plaid gray bags contain 4 dim teal bags, 2 plaid green bags, 5 muted green bags.
+bright orange bags contain 5 muted gray bags, 3 dim violet bags, 1 dark turquoise bag.
+dim purple bags contain 3 dark brown bags, 3 dark cyan bags, 5 faded indigo bags, 1 light coral bag.
+muted magenta bags contain 2 muted white bags.
+vibrant white bags contain 2 wavy lime bags, 2 vibrant gold bags, 1 dim silver bag.
+dull lime bags contain 3 dark salmon bags, 1 mirrored yellow bag, 5 clear salmon bags, 4 light white bags.
+dark fuchsia bags contain 2 wavy salmon bags, 4 bright lavender bags.
+bright bronze bags contain 3 dark turquoise bags, 3 dim maroon bags.
+faded beige bags contain 5 wavy gold bags.
+dotted green bags contain 4 muted red bags, 4 light black bags, 5 wavy cyan bags, 4 mirrored aqua bags.
+light salmon bags contain 4 dim plum bags, 3 dark bronze bags, 3 dotted turquoise bags.
+light red bags contain 4 vibrant gold bags, 5 drab red bags.
+mirrored orange bags contain 5 drab lavender bags, 2 drab aqua bags, 5 mirrored aqua bags, 2 posh blue bags.
+light coral bags contain 3 posh magenta bags, 3 dim maroon bags, 2 light aqua bags.
+dotted purple bags contain 2 plaid purple bags, 3 light chartreuse bags.
+light cyan bags contain 1 dotted magenta bag, 1 drab lime bag, 2 clear magenta bags.
+shiny green bags contain 4 drab silver bags, 4 wavy blue bags.
+dull yellow bags contain 4 wavy maroon bags, 4 bright white bags, 3 wavy white bags.
+vibrant gray bags contain 1 wavy maroon bag, 5 dark yellow bags, 1 wavy silver bag, 1 vibrant silver bag.
+plaid purple bags contain 1 dark yellow bag, 1 faded maroon bag, 1 muted coral bag, 2 clear yellow bags.
+light orange bags contain 1 vibrant black bag, 4 striped brown bags.
+vibrant tomato bags contain 4 plaid cyan bags, 5 dim salmon bags, 1 pale lime bag, 1 dim teal bag.
+shiny coral bags contain 5 shiny blue bags, 1 shiny beige bag, 2 drab silver bags.
+dark aqua bags contain 4 plaid magenta bags, 2 dull cyan bags, 3 dim red bags.
+dotted aqua bags contain 4 pale turquoise bags.
+clear gray bags contain 2 vibrant salmon bags, 4 dim salmon bags, 2 shiny silver bags.
+striped purple bags contain 2 muted salmon bags, 2 posh green bags.
+dark indigo bags contain 1 muted lime bag, 3 posh cyan bags, 2 dull brown bags.
+wavy crimson bags contain 5 pale purple bags, 1 pale black bag, 5 plaid gold bags, 2 dull red bags.
+faded gray bags contain 1 plaid maroon bag, 2 muted red bags, 1 drab turquoise bag, 3 clear maroon bags.
+drab indigo bags contain 1 faded olive bag, 2 pale plum bags, 3 muted aqua bags, 3 muted white bags.
+light green bags contain 3 plaid gray bags.
+posh white bags contain 3 dim salmon bags.
+shiny bronze bags contain 3 pale brown bags.
+light tomato bags contain 4 dim tan bags, 4 dull crimson bags, 4 dark coral bags, 3 mirrored gold bags.
+shiny crimson bags contain 1 vibrant gray bag.
+muted blue bags contain 1 light magenta bag, 4 drab indigo bags, 1 vibrant salmon bag, 4 dim tomato bags.
+wavy maroon bags contain 4 mirrored bronze bags, 3 clear gray bags, 3 muted white bags.
+wavy white bags contain 5 dim salmon bags, 3 striped lavender bags, 3 faded olive bags.
+striped plum bags contain 1 drab purple bag.
+bright lavender bags contain 2 posh white bags.
+posh red bags contain 5 vibrant salmon bags, 3 dark yellow bags, 1 dotted tan bag.
+dark violet bags contain 5 vibrant beige bags, 3 drab lime bags, 1 dull plum bag.
+mirrored aqua bags contain 4 posh orange bags, 4 mirrored fuchsia bags, 1 shiny chartreuse bag.
+dark crimson bags contain 4 dim cyan bags, 2 wavy magenta bags.
+striped cyan bags contain 3 mirrored teal bags, 5 light turquoise bags.
+posh blue bags contain 3 posh indigo bags, 4 clear maroon bags, 5 pale salmon bags, 1 faded yellow bag.
+mirrored tomato bags contain 1 dim silver bag, 3 bright purple bags, 3 clear lavender bags, 2 drab gold bags.
+plaid green bags contain 5 drab indigo bags, 4 vibrant gray bags, 1 vibrant chartreuse bag, 5 mirrored lavender bags.
+clear maroon bags contain 2 shiny beige bags.
+faded turquoise bags contain 4 vibrant crimson bags.
+striped magenta bags contain 3 vibrant salmon bags, 4 dull chartreuse bags, 3 faded olive bags, 2 striped aqua bags.
+dark magenta bags contain 4 mirrored purple bags, 1 dull beige bag, 2 plaid chartreuse bags.
+drab turquoise bags contain 2 dark olive bags, 4 pale plum bags.
+faded tan bags contain 5 dull crimson bags, 3 wavy gray bags.
+muted tan bags contain no other bags.
+dull tan bags contain 2 plaid maroon bags, 3 dark green bags, 3 shiny orange bags.
+striped red bags contain 1 striped maroon bag, 4 clear red bags.
+faded magenta bags contain 3 shiny teal bags, 4 bright crimson bags.
+dull aqua bags contain 5 pale turquoise bags, 5 bright tomato bags, 4 drab lime bags, 3 drab brown bags.
+bright lime bags contain 2 light red bags, 2 shiny olive bags, 4 posh white bags, 2 dotted white bags.
+clear tomato bags contain 1 shiny beige bag, 2 bright lavender bags.
+faded indigo bags contain 5 muted tan bags, 4 dim bronze bags.
+bright yellow bags contain 2 wavy blue bags.
+striped bronze bags contain 3 muted gold bags.
+mirrored fuchsia bags contain 5 faded yellow bags, 5 light cyan bags, 4 striped crimson bags.
+wavy gray bags contain 3 dull chartreuse bags, 2 drab black bags.
+muted coral bags contain 1 light aqua bag, 1 striped lavender bag.
+vibrant lime bags contain 5 posh lavender bags, 2 dim bronze bags, 1 dull silver bag.
+shiny gold bags contain 1 plaid orange bag, 2 striped lavender bags, 4 pale brown bags, 5 wavy blue bags.
+plaid red bags contain 1 light aqua bag, 2 mirrored salmon bags.
+dark brown bags contain 1 dull maroon bag.
+pale fuchsia bags contain 5 striped coral bags, 5 dim tomato bags.
+dull green bags contain 3 mirrored yellow bags, 2 bright lavender bags, 2 faded coral bags, 4 light bronze bags.
+clear coral bags contain 1 mirrored black bag, 5 light chartreuse bags.
+clear fuchsia bags contain 1 clear plum bag, 3 faded maroon bags.
+drab gray bags contain 1 wavy tomato bag, 3 dark cyan bags.
+wavy lavender bags contain 1 dim lavender bag, 3 clear turquoise bags.
+dark tomato bags contain 3 dark red bags, 4 mirrored red bags, 1 plaid plum bag, 2 dark turquoise bags.
+shiny maroon bags contain 2 plaid tomato bags, 2 posh magenta bags.
+plaid bronze bags contain 3 light beige bags.
+dim magenta bags contain 1 clear gold bag, 5 dark orange bags, 3 striped red bags.
+pale aqua bags contain 1 vibrant beige bag, 3 vibrant maroon bags.
+dim red bags contain 1 vibrant silver bag, 3 dark teal bags, 4 muted olive bags, 3 shiny beige bags.
+shiny lavender bags contain 4 dim indigo bags, 4 muted brown bags, 4 dim tan bags, 3 dull white bags.
+wavy turquoise bags contain 5 dim salmon bags, 1 light aqua bag, 3 vibrant salmon bags.
+posh green bags contain 1 drab purple bag.
+dim fuchsia bags contain 3 muted white bags, 3 pale bronze bags, 4 bright aqua bags.
+wavy orange bags contain 5 muted tomato bags.
+dark turquoise bags contain 2 plaid bronze bags.
+shiny silver bags contain no other bags.
+pale gold bags contain 5 posh turquoise bags, 3 posh gray bags, 1 wavy magenta bag, 2 posh beige bags.
+dull chartreuse bags contain no other bags.
+vibrant crimson bags contain 4 striped red bags, 3 light aqua bags, 5 shiny purple bags.
+clear olive bags contain 3 shiny violet bags, 5 posh coral bags, 2 vibrant beige bags, 2 shiny salmon bags.
+vibrant magenta bags contain 2 shiny blue bags, 2 dark brown bags, 5 dim teal bags, 5 pale purple bags.
+faded orange bags contain 2 clear maroon bags, 4 posh tomato bags, 5 vibrant white bags, 3 shiny tan bags.
+drab yellow bags contain 5 wavy maroon bags, 4 dotted fuchsia bags.
+wavy purple bags contain 2 pale lavender bags, 4 faded indigo bags, 5 dotted lavender bags, 3 dim tomato bags.
+drab beige bags contain 4 dark yellow bags, 5 drab indigo bags, 4 faded yellow bags.
+wavy tomato bags contain 3 dim tan bags.
+vibrant beige bags contain 2 bright aqua bags, 2 dull chartreuse bags.
+dull bronze bags contain 3 dotted lavender bags, 3 shiny violet bags, 5 bright blue bags.
+striped gold bags contain 3 dim white bags, 3 drab aqua bags, 4 dotted indigo bags, 5 vibrant black bags.
+shiny yellow bags contain 1 dotted fuchsia bag.
+mirrored salmon bags contain 3 wavy blue bags, 2 striped green bags, 3 dull beige bags, 5 light tan bags.
+clear red bags contain 5 vibrant lime bags, 1 faded maroon bag, 2 striped lavender bags.
+pale black bags contain 4 mirrored crimson bags, 3 drab lavender bags, 4 drab blue bags.
+wavy green bags contain 2 drab lavender bags, 4 light teal bags, 1 mirrored chartreuse bag.
+muted crimson bags contain 3 dim aqua bags.
+dull red bags contain 2 pale cyan bags, 5 dotted indigo bags, 4 drab violet bags.
+dull purple bags contain 2 dull gray bags, 3 dim turquoise bags.
+dull beige bags contain 3 bright white bags, 2 dark orange bags, 3 dull chartreuse bags.
+light silver bags contain 2 muted gold bags, 2 clear chartreuse bags, 1 faded maroon bag, 2 pale plum bags.
+mirrored turquoise bags contain 3 faded black bags, 4 light teal bags, 2 striped plum bags.
+wavy blue bags contain 3 faded indigo bags, 2 wavy white bags, 2 bright aqua bags, 5 light yellow bags.
+faded lime bags contain 2 drab black bags, 4 shiny indigo bags, 2 light black bags, 1 dim green bag.
+plaid brown bags contain 5 light turquoise bags.
+drab gold bags contain 1 mirrored silver bag, 3 dark coral bags, 2 muted green bags.
+vibrant aqua bags contain 5 muted salmon bags, 2 clear gray bags.
+clear turquoise bags contain 4 dark coral bags.
+dark cyan bags contain 2 mirrored silver bags, 1 wavy blue bag, 5 vibrant purple bags.
+striped indigo bags contain 3 dim violet bags, 2 bright aqua bags, 5 shiny orange bags.
+wavy red bags contain 4 dim indigo bags, 5 light gold bags.
+clear cyan bags contain 1 muted cyan bag, 1 muted magenta bag, 2 faded cyan bags.
+shiny violet bags contain 1 mirrored bronze bag, 3 wavy red bags.
+wavy indigo bags contain 1 vibrant cyan bag.
+posh fuchsia bags contain 1 dotted silver bag.
+mirrored white bags contain 2 shiny fuchsia bags, 5 drab indigo bags.
+dotted black bags contain 4 clear magenta bags, 2 dim plum bags, 5 dim red bags.
+vibrant turquoise bags contain 3 dim aqua bags.
+bright green bags contain 3 drab black bags, 3 light magenta bags, 3 dark purple bags.
+bright crimson bags contain 5 faded indigo bags, 2 dim indigo bags, 4 pale purple bags.
+posh beige bags contain 5 dim orange bags, 2 vibrant chartreuse bags, 2 bright crimson bags.
+faded white bags contain 5 drab fuchsia bags, 4 faded cyan bags.
+striped turquoise bags contain 1 muted olive bag.
+bright chartreuse bags contain 5 plaid turquoise bags, 1 muted tomato bag, 1 bright gold bag.
+muted red bags contain 2 faded maroon bags, 2 light chartreuse bags, 5 dark olive bags.
+dull turquoise bags contain 1 striped lavender bag, 5 dark purple bags, 3 dim coral bags.
+pale yellow bags contain 5 muted indigo bags, 2 dull black bags.
+dim indigo bags contain 5 bright aqua bags, 1 shiny silver bag, 2 drab purple bags, 1 muted aqua bag.
+faded blue bags contain 1 pale maroon bag, 3 faded maroon bags.
+plaid olive bags contain 2 plaid cyan bags, 3 dim plum bags, 2 bright salmon bags.
+drab black bags contain 1 faded black bag, 4 light yellow bags, 4 dim bronze bags, 4 drab indigo bags.
+vibrant plum bags contain 5 mirrored lime bags, 4 dim yellow bags, 4 posh tomato bags, 3 light gold bags.
+dotted lime bags contain 5 posh lavender bags, 5 faded purple bags, 4 dim salmon bags, 3 clear tomato bags.
+pale turquoise bags contain 1 muted tan bag, 5 dark orange bags, 4 vibrant salmon bags, 5 dim bronze bags.
+drab blue bags contain 2 posh white bags, 1 muted aqua bag, 2 light fuchsia bags.
+faded olive bags contain no other bags.
+posh black bags contain 2 faded bronze bags, 5 mirrored red bags, 3 dim gray bags.
+shiny orange bags contain 5 dark olive bags, 5 drab indigo bags, 3 faded indigo bags, 3 striped brown bags.
+mirrored blue bags contain 3 posh crimson bags, 2 striped lavender bags, 2 mirrored yellow bags.
+drab purple bags contain 2 light teal bags, 5 striped magenta bags, 3 striped aqua bags.
+bright gray bags contain 2 striped tan bags, 4 bright coral bags.
+dim gold bags contain 2 dull brown bags, 5 mirrored crimson bags, 2 bright tomato bags.
+posh aqua bags contain 2 bright magenta bags, 5 posh orange bags, 2 wavy silver bags, 1 posh plum bag.
+wavy gold bags contain 2 drab purple bags, 5 posh plum bags.
+wavy lime bags contain 4 drab teal bags, 5 drab bronze bags, 1 wavy maroon bag, 4 wavy silver bags.
+muted black bags contain 5 drab gray bags, 3 pale salmon bags, 3 dull indigo bags, 3 pale brown bags.
+bright aqua bags contain 3 dim salmon bags, 1 dark orange bag.
+vibrant brown bags contain 3 dim gray bags.
+striped teal bags contain 1 muted tan bag, 2 pale plum bags.
+drab olive bags contain 2 dotted lavender bags, 1 muted green bag, 4 wavy gray bags.
+shiny blue bags contain 1 pale turquoise bag, 3 faded olive bags.
+dotted yellow bags contain 5 dim blue bags, 2 vibrant silver bags.
+vibrant lavender bags contain 3 posh fuchsia bags, 4 mirrored crimson bags, 5 posh gray bags.
+bright black bags contain 2 striped blue bags.
+pale salmon bags contain 5 bright maroon bags.
+dull white bags contain 2 striped salmon bags, 4 wavy turquoise bags.
+faded teal bags contain 3 vibrant brown bags.
+shiny olive bags contain 3 muted tomato bags, 5 light cyan bags.
+shiny chartreuse bags contain 3 pale olive bags, 2 vibrant chartreuse bags, 3 striped cyan bags.
+muted turquoise bags contain 3 light white bags, 4 pale maroon bags.
+bright tomato bags contain 2 mirrored bronze bags, 3 light aqua bags, 4 bright aqua bags.
+light black bags contain 4 mirrored chartreuse bags.
+bright turquoise bags contain 4 shiny silver bags, 4 wavy blue bags.
+dim coral bags contain 2 dull coral bags, 1 shiny yellow bag, 2 dark lavender bags, 3 light magenta bags.
+clear indigo bags contain 2 faded maroon bags.
+vibrant coral bags contain 3 mirrored teal bags.
+dark red bags contain 3 drab lavender bags.
+posh chartreuse bags contain 3 posh bronze bags, 1 posh crimson bag, 5 dark gray bags, 4 dark silver bags.
+shiny purple bags contain 2 dull silver bags, 4 light aqua bags, 4 posh white bags, 1 clear chartreuse bag.
+dull crimson bags contain 4 bright blue bags.
+vibrant cyan bags contain 4 pale maroon bags, 4 mirrored yellow bags, 4 dark teal bags.
+pale magenta bags contain 1 bright lavender bag, 5 wavy gray bags, 2 dark bronze bags.
+shiny black bags contain 2 striped blue bags, 3 shiny brown bags.
+pale lavender bags contain 3 dark gray bags, 4 vibrant beige bags, 1 dull coral bag.
+dark beige bags contain 2 vibrant tomato bags, 1 shiny chartreuse bag, 4 light coral bags, 1 light violet bag.
+bright violet bags contain 3 plaid lavender bags, 2 faded white bags.
+pale silver bags contain 5 faded maroon bags, 5 clear coral bags, 3 light beige bags.
+clear tan bags contain 4 wavy tan bags.
+striped white bags contain 2 drab indigo bags, 1 faded olive bag, 3 dull chartreuse bags, 3 dotted beige bags.
+muted chartreuse bags contain 4 bright crimson bags, 1 dull bronze bag, 1 dark aqua bag.
+plaid black bags contain 2 striped brown bags, 5 wavy crimson bags, 4 plaid olive bags.
+muted olive bags contain 1 posh white bag, 2 plaid plum bags.
+dim brown bags contain 3 wavy lime bags, 2 bright orange bags, 4 striped aqua bags, 3 bright teal bags.
+striped silver bags contain 2 wavy tan bags, 1 light coral bag.
+drab tomato bags contain 2 dotted fuchsia bags, 4 plaid aqua bags.
+dim chartreuse bags contain 5 pale beige bags, 5 bright brown bags, 1 dull lavender bag.
+clear lavender bags contain 5 wavy maroon bags, 5 drab coral bags, 5 muted tan bags.
+light magenta bags contain 4 wavy white bags, 2 pale salmon bags, 5 muted gold bags, 2 pale cyan bags.
+pale crimson bags contain 5 striped blue bags, 4 pale lavender bags.
+plaid crimson bags contain 5 mirrored black bags, 5 pale magenta bags, 4 wavy plum bags, 3 bright green bags.
+pale cyan bags contain 5 light tan bags, 1 drab purple bag.
+pale teal bags contain 4 wavy magenta bags.
+wavy salmon bags contain 3 muted aqua bags, 1 dull purple bag, 1 drab teal bag, 2 dull gray bags.
+plaid blue bags contain 4 plaid gray bags, 4 dim fuchsia bags, 3 muted purple bags.
+dotted magenta bags contain 3 dotted lavender bags, 4 striped magenta bags.
+striped olive bags contain 3 striped teal bags, 5 faded maroon bags, 4 plaid maroon bags, 4 muted gold bags.
+dotted turquoise bags contain 3 dull cyan bags, 3 shiny yellow bags, 1 striped maroon bag.
+dotted plum bags contain 5 bright plum bags, 4 shiny yellow bags.
+pale bronze bags contain 3 faded salmon bags, 5 muted gray bags, 5 shiny beige bags.
+mirrored beige bags contain 1 vibrant gold bag, 2 posh plum bags, 1 plaid purple bag.
+vibrant purple bags contain 4 bright crimson bags, 3 faded coral bags, 2 striped lavender bags, 3 wavy turquoise bags.
+dim tan bags contain 4 posh indigo bags.
+faded violet bags contain 3 clear silver bags, 5 faded salmon bags.
+dim turquoise bags contain 5 light beige bags.
+faded salmon bags contain 5 shiny purple bags, 3 dim bronze bags, 2 light aqua bags, 5 posh indigo bags.
+dull gray bags contain 4 dotted magenta bags.
+dark purple bags contain 4 striped magenta bags, 4 faded maroon bags.
+muted silver bags contain 5 posh lavender bags.
+drab green bags contain 3 dotted tomato bags, 4 muted gray bags, 1 dim maroon bag, 1 plaid chartreuse bag.
+mirrored indigo bags contain 4 shiny crimson bags.
+muted purple bags contain 4 plaid plum bags, 4 dull gray bags.
+plaid indigo bags contain 5 drab bronze bags, 3 light turquoise bags, 1 dull chartreuse bag, 5 bright blue bags.
+drab bronze bags contain 5 light cyan bags, 1 faded yellow bag.
+clear violet bags contain 5 bright silver bags, 3 mirrored yellow bags.
+faded brown bags contain 5 wavy red bags, 3 muted aqua bags.
+dotted red bags contain 4 clear chartreuse bags.
+drab teal bags contain 5 striped aqua bags, 3 pale salmon bags.
+wavy beige bags contain 3 bright brown bags.
+striped green bags contain 3 wavy blue bags, 5 light aqua bags, 4 light tan bags, 3 mirrored lime bags.
+dark blue bags contain 2 bright crimson bags, 3 striped salmon bags.
+dark bronze bags contain 3 plaid yellow bags, 2 wavy white bags.
+clear crimson bags contain 5 dull white bags, 5 plaid crimson bags, 3 mirrored yellow bags, 3 wavy lime bags.
+dark lavender bags contain 1 striped green bag.
+light maroon bags contain 1 faded fuchsia bag.
+dull coral bags contain 1 mirrored lavender bag.
+plaid cyan bags contain 5 faded maroon bags, 2 light indigo bags, 4 light brown bags.
+drab fuchsia bags contain 4 drab turquoise bags, 2 bright white bags, 3 vibrant chartreuse bags, 2 posh white bags.
+clear orange bags contain 5 clear red bags.
+posh plum bags contain 4 dim indigo bags, 4 muted coral bags, 1 light aqua bag, 5 muted tomato bags.
+dotted salmon bags contain 5 drab aqua bags, 2 faded cyan bags, 4 light red bags, 2 shiny aqua bags.
+clear aqua bags contain 2 shiny red bags, 2 pale white bags.
+clear yellow bags contain 2 dark orange bags, 4 light silver bags, 1 plaid fuchsia bag.
+striped lime bags contain 1 drab lime bag.
+posh silver bags contain 4 posh yellow bags, 4 light orange bags, 3 striped fuchsia bags, 5 dull silver bags.
+wavy black bags contain 5 dim crimson bags, 3 muted violet bags.
+dull silver bags contain 4 vibrant silver bags, 4 dim salmon bags, 4 drab lavender bags.
+light lavender bags contain 4 bright lavender bags, 3 dim gray bags, 4 drab lime bags.
+posh tomato bags contain 4 dark bronze bags, 4 dull silver bags, 5 dull bronze bags.
+wavy brown bags contain 2 clear lime bags, 3 mirrored tan bags, 2 dull coral bags.
+clear salmon bags contain 5 dull white bags, 4 drab purple bags, 3 shiny violet bags, 3 plaid chartreuse bags.
+bright beige bags contain 2 dull tomato bags, 2 drab chartreuse bags.
+dull cyan bags contain 5 bright plum bags, 5 light lavender bags.
+light turquoise bags contain 4 muted green bags, 4 wavy maroon bags, 5 dotted beige bags.
+dark maroon bags contain 2 bright fuchsia bags, 5 dull crimson bags, 5 plaid crimson bags.
+vibrant black bags contain 3 muted red bags.
+wavy aqua bags contain 3 pale plum bags, 5 shiny lime bags.
+plaid turquoise bags contain 3 shiny red bags, 5 bright tomato bags, 3 muted olive bags, 5 pale maroon bags.
+dull tomato bags contain 3 dim yellow bags, 4 posh violet bags, 4 plaid yellow bags.
+drab maroon bags contain 4 drab olive bags.
+dark orange bags contain 2 clear gold bags, 1 striped aqua bag, 2 muted aqua bags, 2 striped magenta bags.
+vibrant chartreuse bags contain 1 dim indigo bag, 1 drab purple bag, 2 shiny gold bags, 3 faded salmon bags.
+striped chartreuse bags contain 3 drab gray bags, 1 drab red bag.
+plaid tomato bags contain 2 dark gray bags, 5 dim bronze bags.
+drab red bags contain 4 light silver bags, 2 drab turquoise bags, 1 striped lavender bag.
+clear green bags contain 1 vibrant magenta bag, 3 plaid beige bags, 2 mirrored tan bags.
+dull teal bags contain 1 vibrant green bag.
+vibrant fuchsia bags contain 2 dull purple bags, 1 drab gold bag, 5 light aqua bags.
+vibrant salmon bags contain no other bags.
+posh teal bags contain 2 light magenta bags, 4 dotted fuchsia bags.
+mirrored gold bags contain 1 posh crimson bag, 5 dull beige bags, 3 plaid salmon bags.
+pale orange bags contain 2 plaid violet bags.
+vibrant maroon bags contain 3 drab teal bags.
+faded coral bags contain 4 muted gold bags, 2 posh white bags, 5 plaid plum bags, 4 mirrored lime bags.
+vibrant teal bags contain 3 faded black bags, 2 posh green bags, 3 plaid fuchsia bags.
+shiny red bags contain 2 striped orange bags, 2 light purple bags.
+mirrored cyan bags contain 4 muted bronze bags, 1 shiny green bag.
+dotted silver bags contain 2 striped indigo bags, 2 dotted magenta bags, 3 striped plum bags, 2 faded brown bags.
+mirrored purple bags contain 2 plaid red bags, 3 dotted beige bags, 3 drab black bags.
+clear lime bags contain 5 faded salmon bags.
+muted fuchsia bags contain 2 dim gold bags, 2 clear gray bags, 1 posh red bag, 2 drab indigo bags.
+mirrored lime bags contain 1 drab turquoise bag, 4 dark yellow bags.
+bright teal bags contain 3 wavy plum bags, 3 plaid red bags, 2 bright tomato bags.
+dark teal bags contain 2 muted coral bags, 1 light tan bag, 5 dotted tan bags.
+faded plum bags contain 4 pale indigo bags, 1 bright plum bag, 2 shiny crimson bags.
+vibrant tan bags contain 3 muted violet bags.
+shiny magenta bags contain 4 posh tan bags, 4 mirrored tan bags, 3 plaid chartreuse bags.
+vibrant orange bags contain 1 vibrant crimson bag, 3 shiny tan bags, 4 dark crimson bags, 1 dotted silver bag.
+muted aqua bags contain no other bags.
+clear silver bags contain 2 faded olive bags, 5 vibrant purple bags.
+plaid fuchsia bags contain 4 vibrant beige bags, 1 mirrored bronze bag.
+muted gold bags contain 2 striped aqua bags, 1 light yellow bag.
+posh cyan bags contain 2 vibrant gold bags, 2 light lavender bags, 5 striped green bags.
+bright tan bags contain 3 pale maroon bags, 4 dim coral bags.
+drab crimson bags contain 3 mirrored chartreuse bags, 5 faded maroon bags, 3 dotted magenta bags, 4 bright brown bags.
+dotted coral bags contain 4 muted aqua bags, 1 striped white bag, 1 dim bronze bag.
+dotted gray bags contain 1 mirrored white bag.
+shiny beige bags contain 2 dim tan bags.
+light brown bags contain 1 dim violet bag.
+shiny fuchsia bags contain 3 dark teal bags, 4 drab purple bags, 2 mirrored bronze bags, 2 dim salmon bags.
+wavy magenta bags contain 4 vibrant gray bags, 5 clear salmon bags.
+light teal bags contain 1 dull beige bag.
+dark yellow bags contain 1 clear chartreuse bag, 4 mirrored bronze bags, 4 dim salmon bags, 4 wavy white bags.
+bright fuchsia bags contain 1 pale magenta bag, 5 muted plum bags.
+muted cyan bags contain 2 shiny tan bags, 5 mirrored blue bags, 1 mirrored chartreuse bag, 2 plaid chartreuse bags.
+dim aqua bags contain 4 pale bronze bags, 2 muted blue bags, 3 clear red bags, 3 light lavender bags.
+pale brown bags contain no other bags.
+plaid salmon bags contain 3 posh coral bags, 3 dim white bags, 2 drab olive bags, 4 shiny violet bags.
+dull fuchsia bags contain 5 striped red bags, 1 pale black bag.
+light purple bags contain 3 plaid orange bags, 5 vibrant red bags.
+dotted lavender bags contain 2 light gold bags, 3 shiny gold bags, 3 dim tan bags.
+dotted gold bags contain 1 muted gray bag.
+wavy cyan bags contain 1 drab teal bag, 2 wavy yellow bags, 1 striped blue bag, 3 dull blue bags.
+striped orange bags contain 1 striped lavender bag, 1 posh white bag, 5 bright aqua bags, 2 shiny silver bags.
+clear bronze bags contain 2 striped gold bags, 3 light tomato bags.
+mirrored teal bags contain 1 bright lavender bag, 4 dim green bags, 4 bright brown bags.
+vibrant green bags contain 4 vibrant violet bags, 5 pale bronze bags.
+muted gray bags contain 5 pale brown bags, 5 mirrored bronze bags, 3 dim tan bags, 3 bright white bags.
+shiny brown bags contain 3 light chartreuse bags.
+pale maroon bags contain 3 drab lavender bags, 1 bright turquoise bag, 1 dim tan bag.
+light fuchsia bags contain 4 plaid bronze bags.
+pale olive bags contain 4 striped teal bags.
+plaid lavender bags contain 5 posh gold bags.
+light yellow bags contain 4 striped aqua bags, 1 dotted aqua bag, 2 dark orange bags, 4 faded olive bags.
+dull indigo bags contain 2 bright indigo bags, 2 dotted plum bags, 3 pale black bags, 5 pale turquoise bags.
+light white bags contain 2 bright brown bags, 3 pale brown bags, 1 faded olive bag.
+mirrored crimson bags contain 2 faded maroon bags, 2 dim maroon bags, 5 faded indigo bags, 2 striped aqua bags.
+dim black bags contain 1 muted silver bag, 4 plaid magenta bags, 3 muted fuchsia bags, 4 dim olive bags.
+dotted fuchsia bags contain 3 mirrored salmon bags, 3 drab purple bags.
+faded tomato bags contain 4 dim gold bags, 4 light olive bags.
+vibrant bronze bags contain 5 mirrored turquoise bags.
+faded red bags contain 1 bright bronze bag, 2 dotted aqua bags.
+vibrant silver bags contain 2 dull chartreuse bags, 3 faded olive bags, 1 shiny blue bag.
+muted green bags contain 2 posh lavender bags, 2 faded indigo bags, 2 mirrored black bags, 5 clear magenta bags.
+pale chartreuse bags contain 2 wavy olive bags, 5 faded orange bags, 1 pale indigo bag, 4 bright plum bags.
+dim bronze bags contain 4 striped magenta bags, 5 faded olive bags, 4 pale brown bags, 4 muted tan bags.
+posh purple bags contain 3 posh indigo bags, 4 faded white bags, 1 dull salmon bag, 2 pale aqua bags.
+drab coral bags contain 5 posh red bags, 4 clear plum bags, 1 faded tomato bag, 5 wavy maroon bags.
+striped fuchsia bags contain 3 pale brown bags.
+striped blue bags contain 4 drab lavender bags, 2 plaid gray bags.
+posh indigo bags contain 2 muted white bags, 5 striped aqua bags.
+mirrored magenta bags contain 4 posh tan bags, 1 light magenta bag.
+dim blue bags contain 4 vibrant purple bags.
+striped maroon bags contain 5 drab black bags, 2 bright beige bags, 5 posh tomato bags, 3 plaid red bags.
+dark lime bags contain 3 drab indigo bags, 1 bright teal bag.
+clear plum bags contain 1 pale cyan bag, 3 wavy white bags.
+muted brown bags contain 3 light indigo bags, 3 light olive bags, 1 light lavender bag.
+posh lavender bags contain 2 striped magenta bags.
+striped tan bags contain 4 pale bronze bags, 3 dull aqua bags.
+dim cyan bags contain 3 dark violet bags, 2 dull brown bags.
+dotted teal bags contain 5 posh gray bags, 2 posh purple bags, 1 vibrant gray bag.
+muted yellow bags contain 1 plaid red bag, 3 faded black bags.
+dotted beige bags contain 2 dotted tan bags.
+wavy plum bags contain 2 mirrored black bags.
+wavy olive bags contain 4 shiny silver bags.
+dotted orange bags contain 2 faded indigo bags, 3 posh lavender bags, 5 plaid fuchsia bags, 1 bright magenta bag.
+dim tomato bags contain 2 faded olive bags, 3 posh tan bags.
+light tan bags contain 5 drab lavender bags, 2 striped lavender bags, 3 posh indigo bags, 3 shiny silver bags.
+posh orange bags contain 3 vibrant green bags, 1 dim orange bag, 5 dull silver bags, 5 wavy orange bags.
+plaid maroon bags contain 5 dim gray bags, 3 muted red bags, 5 posh violet bags, 3 dark green bags.
+dark white bags contain 4 drab chartreuse bags, 2 striped lavender bags, 4 dull aqua bags.
+vibrant indigo bags contain 1 clear plum bag.
\ No newline at end of file
diff --git a/data/advent07a.txt b/data/advent07a.txt
new file mode 100644 (file)
index 0000000..e7ba02e
--- /dev/null
@@ -0,0 +1,9 @@
+light red bags contain 1 bright white bag, 2 muted yellow bags.
+dark orange bags contain 3 bright white bags, 4 muted yellow bags.
+bright white bags contain 1 shiny gold bag.
+muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
+shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.
+dark olive bags contain 3 faded blue bags, 4 dotted black bags.
+vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.
+faded blue bags contain no other bags.
+dotted black bags contain no other bags.
\ No newline at end of file
diff --git a/data/advent07b.txt b/data/advent07b.txt
new file mode 100644 (file)
index 0000000..38b2f50
--- /dev/null
@@ -0,0 +1,7 @@
+shiny gold bags contain 2 dark red bags.
+dark red bags contain 2 dark orange bags.
+dark orange bags contain 2 dark yellow bags.
+dark yellow bags contain 2 dark green bags.
+dark green bags contain 2 dark blue bags.
+dark blue bags contain 2 dark violet bags.
+dark violet bags contain no other bags.
\ No newline at end of file
diff --git a/problems/day07.html b/problems/day07.html
new file mode 100644 (file)
index 0000000..debec9f
--- /dev/null
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html lang="en-us">
+<head>
+<meta charset="utf-8"/>
+<title>Day 7 - Advent of Code 2020</title>
+<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
+<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'/>
+<link rel="stylesheet" type="text/css" href="/static/style.css?25"/>
+<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
+<link rel="shortcut icon" href="/favicon.png"/>
+</head><!--
+
+
+
+
+Oh, hello!  Funny seeing you here.
+
+I appreciate your enthusiasm, but you aren't going to find much down here.
+There certainly aren't clues to any of the puzzles.  The best surprises don't
+even appear in the source until you unlock them for real.
+
+Please be careful with automated requests; I'm not a massive company, and I can
+only take so much traffic.  Please be considerate so that everyone gets to play.
+
+If you're curious about how Advent of Code works, it's running on some custom
+Perl code. Other than a few integrations (auth, analytics, social media), I
+built the whole thing myself, including the design, animations, prose, and all
+of the puzzles.
+
+The puzzles are most of the work; preparing a new calendar and a new set of
+puzzles each year takes all of my free time for 4-5 months. A lot of effort
+went into building this thing - I hope you're enjoying playing it as much as I
+enjoyed making it for you!
+
+If you'd like to hang out, I'm @ericwastl on Twitter.
+
+- Eric Wastl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-->
+<body>
+<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2020/about">[About]</a></li><li><a href="/2020/events">[Events]</a></li><li><a href="https://teespring.com/stores/advent-of-code" target="_blank">[Shop]</a></li><li><a href="/2020/settings">[Settings]</a></li><li><a href="/2020/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <a href="/2020/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <span class="star-count">14*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a href="/2020">2020</a><span class="title-event-wrap">;</span></h1><nav><ul><li><a href="/2020">[Calendar]</a></li><li><a href="/2020/support">[AoC++]</a></li><li><a href="/2020/sponsors">[Sponsors]</a></li><li><a href="/2020/leaderboard">[Leaderboard]</a></li><li><a href="/2020/stats">[Stats]</a></li></ul></nav></div></header>
+
+<div id="sidebar">
+<div id="sponsor"><div class="quiet">Our <a href="/2020/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="https://whimsical.com/advent-of-code-2020-get-unstuck-with-whimsical-7hoTGmwqttswvigWHqAgpU@2Ux7TurymLzKXw2f4wcD" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Whimsical</a> - Brainstorm visually. FAST. Stuck on a puzzle? We can help!</div></div>
+</div><!--/sidebar-->
+
+<main>
+<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
+<article class="day-desc"><h2>--- Day 7: Handy Haversacks ---</h2><p>You land at the regional airport in time for your next flight. In fact, it looks like you'll even have time to grab some food: all flights are currently delayed due to <em>issues in luggage processing</em>.</p>
+<p>Due to recent aviation regulations, many rules (your puzzle input) are being enforced about bags and their contents; bags must be color-coded and must contain specific quantities of other color-coded bags. Apparently, nobody responsible for these regulations considered how long they would take to enforce!</p>
+<p>For example, consider the following rules:</p>
+<pre><code>light red bags contain 1 bright white bag, 2 muted yellow bags.
+dark orange bags contain 3 bright white bags, 4 muted yellow bags.
+bright white bags contain 1 shiny gold bag.
+muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
+shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.
+dark olive bags contain 3 faded blue bags, 4 dotted black bags.
+vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.
+faded blue bags contain no other bags.
+dotted black bags contain no other bags.
+</code></pre>
+<p>These rules specify the required contents for 9 bag types. In this example, every <code>faded blue</code> bag is empty, every <code>vibrant plum</code> bag contains 11 bags (5 <code>faded blue</code> and 6 <code>dotted black</code>), and so on.</p>
+<p>You have a <code><em>shiny gold</em></code> bag. If you wanted to carry it in at least one other bag, how many different bag colors would be valid for the outermost bag? (In other words: how many colors can, eventually, contain at least one <code>shiny gold</code> bag?)</p>
+<p>In the above rules, the following options would be available to you:</p>
+<ul>
+<li>A <code>bright white</code> bag, which can hold your <code>shiny gold</code> bag directly.</li>
+<li>A <code>muted yellow</code> bag, which can hold your <code>shiny gold</code> bag directly, plus some other bags.</li>
+<li>A <code>dark orange</code> bag, which can hold <code>bright white</code> and <code>muted yellow</code> bags, either of which could then hold your <code>shiny gold</code> bag.</li>
+<li>A <code>light red</code> bag, which can hold <code>bright white</code> and <code>muted yellow</code> bags, either of which could then hold your <code>shiny gold</code> bag.</li>
+</ul>
+<p>So, in this example, the number of bag colors that can eventually contain at least one <code>shiny gold</code> bag is <code><em>4</em></code>.</p>
+<p><em>How many bag colors can eventually contain at least one <code>shiny gold</code> bag?</em> (The list of rules is quite long; make sure you get all of it.)</p>
+</article>
+<p>Your puzzle answer was <code>242</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>It's getting pretty expensive to fly these days - not because of ticket prices, but because of the ridiculous number of bags you need to buy!</p>
+<p>Consider again your <code>shiny gold</code> bag and the rules from the above example:</p>
+<ul>
+<li><code>faded blue</code> bags contain <code>0</code> other bags.</li>
+<li><code>dotted black</code> bags contain <code>0</code> other bags.</li>
+<li><code>vibrant plum</code> bags contain <code>11</code> other bags: 5 <code>faded blue</code> bags and 6 <code>dotted black</code> bags.</li>
+<li><code>dark olive</code> bags contain <code>7</code> other bags: 3 <code>faded blue</code> bags and 4 <code>dotted black</code> bags.</li>
+</ul>
+<p>So, a single <code>shiny gold</code> bag must contain 1 <code>dark olive</code> bag (and the 7 bags within it) plus 2 <code>vibrant plum</code> bags (and the 11 bags within <em>each</em> of those): <code>1 + 1*7 + 2 + 2*11</code> = <code><em>32</em></code> bags!</p>
+<p>Of course, the actual rules have a <span title="100%">small</span> chance of going several levels deeper than this example; be sure to count all of the bags, even if the nesting becomes topologically impractical!</p>
+<p>Here's another example:</p>
+<pre><code>shiny gold bags contain 2 dark red bags.
+dark red bags contain 2 dark orange bags.
+dark orange bags contain 2 dark yellow bags.
+dark yellow bags contain 2 dark green bags.
+dark green bags contain 2 dark blue bags.
+dark blue bags contain 2 dark violet bags.
+dark violet bags contain no other bags.
+</code></pre>
+<p>In this example, a single <code>shiny gold</code> bag must contain <code><em>126</em></code> other bags.</p>
+<p><em>How many individual bags are required inside your single <code>shiny gold</code> bag?</em></p>
+</article>
+<p>Your puzzle answer was <code>176035</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, you should <a href="/2020">return to your Advent calendar</a> and try another puzzle.</p>
+<p>If you still want to see it, you can <a href="7/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also <span class="share">[Share<span class="share-content">on
+  <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Handy+Haversacks%22+%2D+Day+7+%2D+Advent+of+Code+2020&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F7&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
+  <a href="javascript:void(0);" onclick="var mastodon_instance=prompt('Mastodon Instance / Server Name?'); if(typeof mastodon_instance==='string' && mastodon_instance.length){this.href='https://'+mastodon_instance+'/share?text=I%27ve+completed+%22Handy+Haversacks%22+%2D+Day+7+%2D+Advent+of+Code+2020+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F7'}else{return false;}" target="_blank">Mastodon</a
+></span>]</span> this puzzle.</p>
+</main>
+
+<!-- ga -->
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ga('create', 'UA-69522494-1', 'auto');
+ga('set', 'anonymizeIp', true);
+ga('send', 'pageview');
+</script>
+<!-- /ga -->
+</body>
+</html>
\ No newline at end of file
diff --git a/problems/day4.html b/problems/day4.html
deleted file mode 100644 (file)
index 0fa2d68..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-<!DOCTYPE html>
-<html lang="en-us">
-<head>
-<meta charset="utf-8"/>
-<title>Day 4 - Advent of Code 2020</title>
-<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
-<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'/>
-<link rel="stylesheet" type="text/css" href="/static/style.css?25"/>
-<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
-<link rel="shortcut icon" href="/favicon.png"/>
-</head><!--
-
-
-
-
-Oh, hello!  Funny seeing you here.
-
-I appreciate your enthusiasm, but you aren't going to find much down here.
-There certainly aren't clues to any of the puzzles.  The best surprises don't
-even appear in the source until you unlock them for real.
-
-Please be careful with automated requests; I'm not a massive company, and I can
-only take so much traffic.  Please be considerate so that everyone gets to play.
-
-If you're curious about how Advent of Code works, it's running on some custom
-Perl code. Other than a few integrations (auth, analytics, social media), I
-built the whole thing myself, including the design, animations, prose, and all
-of the puzzles.
-
-The puzzles are most of the work; preparing a new calendar and a new set of
-puzzles each year takes all of my free time for 4-5 months. A lot of effort
-went into building this thing - I hope you're enjoying playing it as much as I
-enjoyed making it for you!
-
-If you'd like to hang out, I'm @ericwastl on Twitter.
-
-- Eric Wastl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--->
-<body>
-<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2020/about">[About]</a></li><li><a href="/2020/events">[Events]</a></li><li><a href="https://teespring.com/stores/advent-of-code" target="_blank">[Shop]</a></li><li><a href="/2020/settings">[Settings]</a></li><li><a href="/2020/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <a href="/2020/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <span class="star-count">8*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">0x0000|</span><a href="/2020">2020</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2020">[Calendar]</a></li><li><a href="/2020/support">[AoC++]</a></li><li><a href="/2020/sponsors">[Sponsors]</a></li><li><a href="/2020/leaderboard">[Leaderboard]</a></li><li><a href="/2020/stats">[Stats]</a></li></ul></nav></div></header>
-
-<div id="sidebar">
-<div id="sponsor"><div class="quiet">Our <a href="/2020/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="https://medium.com/building-trayio" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">tray.io</a> - Building a platform that connects people with technology.</div></div>
-</div><!--/sidebar-->
-
-<main>
-<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
-<article class="day-desc"><h2>--- Day 4: Passport Processing ---</h2><p>You arrive at the airport only to realize that you grabbed your North Pole Credentials instead of your passport. While these documents are extremely similar, North Pole Credentials aren't issued by a country and therefore aren't actually valid documentation for travel in most of the world.</p>
-<p>It seems like you're not the only one having problems, though; a very long line has formed for the automatic passport scanners, and the delay could upset your travel itinerary.</p>
-<p>Due to some questionable network security, you realize you might be able to solve both of these problems at the same time.</p>
-<p>The automatic passport scanners are slow because they're having trouble <em>detecting which passports have all required fields</em>. The expected fields are as follows:</p>
-<ul>
-<li><code>byr</code> (Birth Year)</li>
-<li><code>iyr</code> (Issue Year)</li>
-<li><code>eyr</code> (Expiration Year)</li>
-<li><code>hgt</code> (Height)</li>
-<li><code>hcl</code> (Hair Color)</li>
-<li><code>ecl</code> (Eye Color)</li>
-<li><code>pid</code> (Passport ID)</li>
-<li><code>cid</code> (Country ID)</li>
-</ul>
-<p>Passport data is validated in batch files (your puzzle input). Each passport is represented as a sequence of <code>key:value</code> pairs separated by spaces or newlines. Passports are separated by blank lines.</p>
-<p>Here is an example batch file containing four passports:</p>
-<pre><code>ecl:gry pid:860033327 eyr:2020 hcl:#fffffd
-byr:1937 iyr:2017 cid:147 hgt:183cm
-
-iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884
-hcl:#cfa07d byr:1929
-
-hcl:#ae17e1 iyr:2013
-eyr:2024
-ecl:brn pid:760753108 byr:1931
-hgt:179cm
-
-hcl:#cfa07d eyr:2025 pid:166559648
-iyr:2011 ecl:brn hgt:59in
-</code></pre>
-<p>The first passport is <em>valid</em> - all eight fields are present. The second passport is <em>invalid</em> - it is missing <code>hgt</code> (the Height field).</p>
-<p>The third passport is interesting; the <em>only missing field</em> is <code>cid</code>, so it looks like data from North Pole Credentials, not a passport at all! Surely, nobody would mind if you made the system temporarily ignore missing <code>cid</code> fields.  Treat this "passport" as <em>valid</em>.</p>
-<p>The fourth passport is missing two fields, <code>cid</code> and <code>byr</code>. Missing <code>cid</code> is fine, but missing any other field is not, so this passport is <em>invalid</em>.</p>
-<p>According to the above rules, your improved system would report <code><em>2</em></code> valid passports.</p>
-<p>Count the number of <em>valid</em> passports - those that have all required fields. Treat <code>cid</code> as optional. <em>In your batch file, how many passports are valid?</em></p>
-</article>
-<p>Your puzzle answer was <code>247</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The line is moving more quickly now, but you overhear airport security talking about how passports with invalid data are getting through. Better add some data validation, quick!</p>
-<p>You can continue to ignore the <code>cid</code> field, but each other field has <span title="GLORY TO ARSTOTZKA">strict rules</span> about what values are valid for automatic validation:</p>
-<ul>
-<li><code>byr</code> (Birth Year) - four digits; at least <code>1920</code> and at most <code>2002</code>.</li>
-<li><code>iyr</code> (Issue Year) - four digits; at least <code>2010</code> and at most <code>2020</code>.</li>
-<li><code>eyr</code> (Expiration Year) - four digits; at least <code>2020</code> and at most <code>2030</code>.</li>
-<li><code>hgt</code> (Height) - a number followed by either <code>cm</code> or <code>in</code>:
-  <ul>
-  <li>If <code>cm</code>, the number must be at least <code>150</code> and at most <code>193</code>.</li>
-  <li>If <code>in</code>, the number must be at least <code>59</code> and at most <code>76</code>.</li>
-  </ul>
-</li>
-<li><code>hcl</code> (Hair Color) - a <code>#</code> followed by exactly six characters <code>0</code>-<code>9</code> or <code>a</code>-<code>f</code>.</li>
-<li><code>ecl</code> (Eye Color) - exactly one of: <code>amb</code> <code>blu</code> <code>brn</code> <code>gry</code> <code>grn</code> <code>hzl</code> <code>oth</code>.</li>
-<li><code>pid</code> (Passport ID) - a nine-digit number, including leading zeroes.</li>
-<li><code>cid</code> (Country ID) - ignored, missing or not.</li>
-</ul>
-<p>Your job is to count the passports where all required fields are both <em>present</em> and <em>valid</em> according to the above rules. Here are some example values:</p>
-<pre><code>byr valid:   2002
-byr invalid: 2003
-
-hgt valid:   60in
-hgt valid:   190cm
-hgt invalid: 190in
-hgt invalid: 190
-
-hcl valid:   #123abc
-hcl invalid: #123abz
-hcl invalid: 123abc
-
-ecl valid:   brn
-ecl invalid: wat
-
-pid valid:   000000001
-pid invalid: 0123456789
-</code></pre>
-<p>Here are some invalid passports:</p>
-<pre><code>eyr:1972 cid:100
-hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926
-
-iyr:2019
-hcl:#602927 eyr:1967 hgt:170cm
-ecl:grn pid:012533040 byr:1946
-
-hcl:dab227 iyr:2012
-ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277
-
-hgt:59cm ecl:zzz
-eyr:2038 hcl:74454a iyr:2023
-pid:3556412378 byr:2007
-</code></pre>
-<p>Here are some valid passports:</p>
-<pre><code>pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980
-hcl:#623a2f
-
-eyr:2029 ecl:blu cid:129 byr:1989
-iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm
-
-hcl:#888785
-hgt:164cm byr:2001 iyr:2015 cid:88
-pid:545766238 ecl:hzl
-eyr:2022
-
-iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719
-</code></pre>
-<p>Count the number of <em>valid</em> passports - those that have all required fields <em>and valid values</em>. Continue to treat <code>cid</code> as optional. <em>In your batch file, how many passports are valid?</em></p>
-</article>
-<p>Your puzzle answer was <code>145</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
-<p>At this point, you should <a href="/2020">return to your Advent calendar</a> and try another puzzle.</p>
-<p>If you still want to see it, you can <a href="4/input" target="_blank">get your puzzle input</a>.</p>
-<p>You can also <span class="share">[Share<span class="share-content">on
-  <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Passport+Processing%22+%2D+Day+4+%2D+Advent+of+Code+2020&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F4&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
-  <a href="javascript:void(0);" onclick="var mastodon_instance=prompt('Mastodon Instance / Server Name?'); if(typeof mastodon_instance==='string' && mastodon_instance.length){this.href='https://'+mastodon_instance+'/share?text=I%27ve+completed+%22Passport+Processing%22+%2D+Day+4+%2D+Advent+of+Code+2020+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F4'}else{return false;}" target="_blank">Mastodon</a
-></span>]</span> this puzzle.</p>
-</main>
-
-<!-- ga -->
-<script>
-(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-ga('create', 'UA-69522494-1', 'auto');
-ga('set', 'anonymizeIp', true);
-ga('send', 'pageview');
-</script>
-<!-- /ga -->
-</body>
-</html>
\ No newline at end of file
index c187ba75fe51a427e77d23bded1271f8cb4d7bd2..e7e925dcbbbf76b13c16655019d262b27de124a0 100644 (file)
@@ -41,6 +41,7 @@ packages:
 - advent04
 - advent05
 - advent06
 - advent04
 - advent05
 - advent06
+- advent07
 
 # Dependency packages to be pulled from upstream that are not in the resolver.
 # These entries can reference officially published versions as well as
 
 # Dependency packages to be pulled from upstream that are not in the resolver.
 # These entries can reference officially published versions as well as