1
0
Fork 0

Compare commits

..

No commits in common. "29c5ea7841ee0402462cfda6ed3f1f327d7fd692" and "caf3d3b43ddea960eff37b8a221cf69fad9927df" have entirely different histories.

6 changed files with 62 additions and 1244 deletions

16
.gitignore vendored
View File

@ -1,11 +1,11 @@
# # Ignore all executables
# ### Ignore all
# *
# ### Unignore all with extensions
# !*.*
# ### Unignore all dirs
# !*/
Main
# Ignore all executables
### Ignore all
*
### Unignore all with extensions
!*.*
### Unignore all dirs
!*/
# Regular gitignore
.direnv

View File

@ -11,8 +11,6 @@
"factorise",
"foldl",
"HLINT",
"mempty",
"Prec",
"unrecognised"
]
}
}

View File

@ -1,20 +1,20 @@
-- https://adventofcode.com/2023/day/1
import Data.Bifunctor (bimap, second)
import Data.Maybe (fromJust, fromMaybe, isJust)
import Data.Text (Text, pack, replace, unpack)
import Data.Bifunctor (bimap)
import Data.Maybe (fromMaybe)
import Text.ParserCombinators.ReadP (ReadP, choice, many, readP_to_S,
string, (<++))
main :: IO ()
main = do
entries <- lines <$> readFile "src/advent_of_code/2023/input1"
print "Advent of Code 2023 - Day 1"
print "Advent of Code 2022 - Day 4"
-- print entries
print ("Part 1: " <> show (solveP1 entries))
print ("Part 2: " <> show (solveP2 entries))
--
-- Part 1
--
@ -36,11 +36,26 @@ solveP2 :: [String] -> Int
solveP2 = sum . map solveP2Line
solveP2Line :: String -> Int
solveP2Line = sumPairS . bimap head last . doubleString . map stringToNum . filter isNumP2 . tokenized tokensP2 . replaceAll overlaps
solveP2Line = sumPairS . bimap a b . doubleString
where
a = head . condense . fromLeft
b = last . condense . fromRight
-- Need to parse from both sides
-- "oneight" should return 18, not 11
condense = map stringToNum . filter isNumP2
fromLeft = tokenized tokensP2
fromRight = map reverse . reverse . tokenized tokensP2' . reverse
tokensP2 :: ReadP String
tokensP2 = parseNumberWords <++ parseNumberChars <++ parseChars
tokensP2' :: ReadP String
tokensP2' = parseNumberWords' <++ parseNumberChars <++ parseChars
solveP2LineBad :: String -> Int
solveP2LineBad = sumPairS . bimap head last . doubleString . map stringToNum . filter isNumP2 . tokenized tokensP2
--
-- Utility functions
--
@ -79,64 +94,47 @@ numberChars = map show [0..9]
numberWords :: [String]
numberWords = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
parseChars :: ReadP String
parseChars = choice $ map (\c -> string [c]) letterChars
overlapsSpec :: [(String, String)]
overlapsSpec =
[ ("zero" , "one" )
, ("one" , "eight")
, ("two" , "one" )
, ("three", "eight")
, ("five" , "eight")
, ("seven", "nine" )
, ("eight", "two" )
, ("eight", "three")
, ("nine" , "eight")
]
parseNumberChars :: ReadP String
parseNumberChars = choice $ map string numberChars
overlapsDerived :: [(String, [String])]
overlapsDerived = zip numberWords $ map findOverlaps numberWords
findOverlaps :: String -> [String]
findOverlaps str = filter (\s -> last str == head s) numberWords
combineOverlaps :: (String, [String]) -> [String]
combineOverlaps (numStr, [] ) = []
combineOverlaps (numStr, over:laps) = (numStr ++ tail over) : combineOverlaps (numStr, laps)
overlaps :: [String]
overlaps = filter (/= "") $ concatMap combineOverlaps overlapsDerived
parseNumberWords :: ReadP String
parseNumberWords = choice $ map string numberWords
parseNumberWords' :: ReadP String
parseNumberWords' = choice $ map (string . reverse) numberWords
parseNumberChars :: ReadP String
parseNumberChars = choice $ map string numberChars
parseChars :: ReadP String
parseChars = choice $ map (\c -> string [c]) letterChars
tokenized :: ReadP a -> String -> [a]
tokenized tokenSet = fst . last . readP_to_S (many tokenSet)
--
-- Detecting overlaps
-- - Instead of reversing to tokenize from the right, I'm using the numberWords list to create a set of possible string overlaps
-- - later I'll detect these and replace them, to be able to parse all strings from left to right
--
overlaps :: [(String, String)]
overlaps = concatMap combineOverlaps overlapsDerived
-- Not used, but the full list written manually
overlapsSpec :: [((String, String), String)]
overlapsSpec =
[ (("zero" , "one" ), "01")
, (("one" , "eight"), "18")
, (("two" , "one" ), "21")
, (("three", "eight"), "38")
, (("five" , "eight"), "58")
, (("seven", "nine" ), "79")
, (("eight", "two" ), "82")
, (("eight", "three"), "83")
, (("nine" , "eight"), "98")
]
overlapsDerived :: [(String, [String])]
overlapsDerived = map (second fromJust) . filter (isJust . snd) . zip numberWords $ map findOverlaps numberWords
where
findOverlaps :: String -> Maybe [String]
findOverlaps str = if null overlaps then Nothing else Just overlaps
where
overlaps = filter (\s -> last str == head s) numberWords
combineOverlaps :: (String, [String]) -> [(String, String)]
combineOverlaps (numStr, [] ) = []
combineOverlaps (numStr, over:laps) = (numStr ++ tail over, stringToNum numStr ++ stringToNum over) : combineOverlaps (numStr, laps)
-- String replace using Text lol
replace' :: String -> String -> String -> String
replace' needle replacement haystack = unpack $ replace needle' replacement' haystack'
where
needle' = pack needle
replacement' = pack replacement
haystack' = pack haystack
replaceAll :: [(String, String)] -> String -> String
replaceAll overlaps str = foldl (\haystack (needle, replacement) -> replace' needle replacement haystack) str overlaps
--
-- Examples
--

View File

@ -1,78 +0,0 @@
-- https://adventofcode.com/2023/day/2
{-# LANGUAGE OverloadedStrings #-}
import Data.Bifunctor (Bifunctor (bimap, second))
import Data.Char (isSpace)
import Data.List (foldl', sort, (!!))
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
main :: IO ()
main = do
entries <- T.lines <$> T.readFile "src/advent_of_code/2023/input2"
putStrLn "Advent of Code 2023 - Day 2"
-- print entries
putStrLn ("Part 1: " <> show (solveP1 entries))
-- putStrLn ("Part 2: " <> show (solveP2 entries))
--
-- Part 1
--
data Colour
= Red
| Green
| Blue
deriving (Show, Read, Ord, Eq)
data Cube c n
= Cube c n
deriving (Show, Read, Ord, Eq)
cubeLessThanLimit :: (Cube Colour Int, Cube Colour Int, Cube Colour Int) -> Cube Colour Int -> Bool
cubeLessThanLimit (Cube Red n, _, _) (Cube Red v) = v <= n
cubeLessThanLimit (_, Cube Green n, _) (Cube Green v) = v <= n
cubeLessThanLimit (_, _, Cube Blue n) (Cube Blue v) = v <= n
lessThanP1 :: Cube Colour Int -> Bool
lessThanP1 = cubeLessThanLimit p1Limit
p1Limit :: (Cube Colour Int, Cube Colour Int, Cube Colour Int)
p1Limit = (Cube Red 12, Cube Green 13, Cube Blue 14)
solveP1 :: [Text] -> Int
solveP1 = sum . map fst . filter snd . map (second (all (== True) . concatMap (map lessThanP1)) . parseInput)
--
-- Part 2
--
solveP2 = id
--
-- Parsing
--
parseInput :: Text -> (Int, [[Cube Colour Int]])
parseInput = bimap (read . T.unpack . T.drop 5) (map (map stringToCube . T.splitOn ", ") . T.splitOn "; " . T.drop 2) . T.breakOn ": "
stringToCube :: Text -> Cube Colour Int
stringToCube str = read $ "Cube " <> colour' <> " " <> n'
where
(n, colour) = second (T.drop 1) . T.break isSpace $ str
colour' = T.unpack (T.toTitle colour)
n' = T.unpack n
--
-- Examples
--
example1 :: [Text]
example1 =
[ "Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green"
, "Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue"
, "Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red"
, "Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red"
, "Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green"
]

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +0,0 @@
Game 1: 8 green; 5 green, 6 blue, 1 red; 2 green, 1 blue, 4 red; 10 green, 1 red, 2 blue; 2 blue, 3 red
Game 2: 10 blue, 12 red; 8 red; 7 green, 5 red, 7 blue
Game 3: 1 red, 15 blue, 3 green; 8 blue, 2 red, 4 green; 2 red, 5 green, 9 blue
Game 4: 8 green, 4 blue, 1 red; 3 green; 4 blue, 1 red, 12 green; 5 green, 1 red, 8 blue; 3 green, 5 blue, 1 red
Game 5: 2 green, 8 blue; 7 blue, 4 green; 7 blue; 5 blue; 5 green, 2 blue, 1 red
Game 6: 6 blue, 3 green; 18 green, 8 blue; 9 green, 4 blue; 4 blue, 2 red, 3 green
Game 7: 15 red, 12 blue, 15 green; 12 blue, 18 green; 9 blue, 11 red; 16 green, 6 blue, 18 red; 6 blue, 12 red; 14 red, 18 green, 12 blue
Game 8: 6 red, 13 blue, 3 green; 18 blue; 3 green, 8 red
Game 9: 3 blue, 4 red; 8 red, 2 blue; 4 green, 8 red, 3 blue; 6 red, 1 blue; 16 green, 2 red, 2 blue
Game 10: 3 red, 7 blue, 2 green; 1 green, 15 red, 5 blue; 1 red, 5 blue; 3 blue, 4 green
Game 11: 12 green, 3 blue; 3 red; 1 red, 6 blue, 9 green; 7 blue, 1 red, 13 green; 1 blue, 5 green, 4 red; 18 green, 3 red
Game 12: 9 green, 13 blue; 3 red, 4 blue, 4 green; 10 green, 7 red, 5 blue; 9 red, 12 blue, 3 green
Game 13: 15 red, 18 blue, 10 green; 11 red, 3 green, 4 blue; 2 green, 12 blue, 4 red
Game 14: 12 blue, 6 red; 2 blue, 7 green, 6 red; 12 blue, 7 green; 4 blue, 1 green, 4 red; 9 green, 12 blue; 3 red, 5 green, 8 blue
Game 15: 9 green, 1 blue; 14 green, 4 red, 1 blue; 1 blue, 6 green, 2 red; 7 red, 13 green, 2 blue; 4 red, 9 green; 2 green, 1 blue, 2 red
Game 16: 3 blue, 2 green, 5 red; 4 green, 3 blue, 4 red; 6 red, 5 blue, 2 green; 3 red, 11 blue; 6 green, 15 blue, 4 red
Game 17: 15 blue, 3 green, 2 red; 2 green, 2 red, 15 blue; 1 red, 1 blue, 7 green
Game 18: 2 blue, 9 red; 12 red, 1 green, 6 blue; 5 red, 5 blue, 2 green
Game 19: 3 red, 4 green, 8 blue; 10 red, 8 green, 1 blue; 13 blue, 7 green, 10 red; 6 red, 1 green, 11 blue; 9 green, 7 blue, 10 red; 7 blue, 7 red
Game 20: 8 blue, 4 green, 14 red; 4 green, 16 red, 1 blue; 10 blue, 14 red, 8 green; 4 green, 13 blue, 20 red; 5 blue, 5 green, 1 red
Game 21: 4 green, 10 blue, 5 red; 11 blue, 4 green, 1 red; 3 blue, 3 red, 2 green; 1 red, 11 blue, 6 green; 1 green, 9 blue, 5 red; 7 blue, 5 green
Game 22: 3 green, 7 blue, 6 red; 12 red, 11 blue, 2 green; 1 blue, 1 green, 15 red; 6 blue, 1 green, 8 red; 4 blue, 1 red; 2 blue, 1 green, 5 red
Game 23: 2 blue, 5 green, 13 red; 1 green, 5 blue, 16 red; 6 blue, 9 green, 9 red; 7 green, 3 blue
Game 24: 2 green; 2 red, 7 blue, 17 green; 5 red, 6 blue, 13 green; 1 green, 6 blue; 2 green, 4 red, 2 blue; 4 blue, 2 green
Game 25: 2 green, 5 blue, 9 red; 2 green, 8 red, 5 blue; 3 green, 1 red, 19 blue
Game 26: 3 green, 2 blue, 8 red; 4 red, 2 blue; 11 red, 3 green; 9 red, 3 green, 6 blue; 10 red, 1 green, 2 blue; 4 blue, 4 green, 14 red
Game 27: 1 green, 4 red, 7 blue; 13 red; 17 red
Game 28: 5 red, 17 green, 15 blue; 7 blue; 7 red, 12 green, 10 blue; 5 red, 11 blue, 3 green
Game 29: 4 blue, 9 red, 9 green; 2 green, 10 red, 2 blue; 3 red, 4 blue, 6 green; 2 green, 17 red, 1 blue; 2 red, 7 green, 1 blue
Game 30: 16 red, 5 blue, 11 green; 5 blue, 5 green, 9 red; 7 green, 1 red, 6 blue
Game 31: 3 green, 11 blue; 5 green; 8 green, 13 blue; 4 red, 10 blue, 8 green
Game 32: 11 blue, 5 green, 4 red; 7 blue; 1 red, 1 green, 7 blue; 7 red, 1 blue, 4 green
Game 33: 7 red, 3 green, 6 blue; 2 red, 16 green, 5 blue; 1 blue, 2 red, 8 green
Game 34: 1 blue, 1 red, 1 green; 9 red, 6 green; 2 blue, 8 red, 6 green; 1 blue, 12 green, 13 red
Game 35: 10 red, 9 green; 1 red, 4 blue, 4 green; 7 blue, 3 green, 4 red
Game 36: 5 red, 6 green, 4 blue; 9 green, 1 red; 12 red, 12 green, 4 blue; 3 red; 18 green, 5 red, 4 blue
Game 37: 10 green, 4 blue, 2 red; 1 red, 3 blue, 9 green; 5 blue, 4 green, 1 red; 6 green, 12 blue; 7 green, 1 red, 13 blue; 9 green, 20 blue, 2 red
Game 38: 9 blue, 20 red, 2 green; 3 blue, 6 green, 19 red; 10 green, 8 red, 2 blue; 4 blue, 4 red, 3 green
Game 39: 4 green, 2 blue, 4 red; 16 blue, 1 red, 2 green; 13 red, 2 green; 16 blue, 7 red, 3 green
Game 40: 8 blue, 2 green, 2 red; 7 blue, 2 red, 1 green; 8 green, 12 blue, 2 red; 2 red, 3 blue, 8 green
Game 41: 9 blue, 2 green; 10 blue, 3 green; 1 green, 9 blue, 3 red; 3 blue, 3 green; 12 blue, 1 red; 3 blue, 1 green, 1 red
Game 42: 1 blue, 1 green, 8 red; 1 blue, 1 red; 2 red, 1 green
Game 43: 5 red, 2 green, 8 blue; 11 blue, 10 green, 1 red; 11 blue, 7 red
Game 44: 9 red, 3 green; 9 red, 1 blue, 6 green; 14 red, 5 green; 4 red, 2 green, 1 blue
Game 45: 5 blue, 1 red, 1 green; 5 blue, 1 red; 6 blue; 10 blue, 1 green; 1 red
Game 46: 4 green, 8 blue, 13 red; 12 green, 11 blue, 12 red; 1 green, 13 red, 1 blue; 12 red, 8 green, 12 blue
Game 47: 1 green, 16 blue, 15 red; 1 blue; 18 red, 10 blue, 9 green; 17 blue, 16 red, 5 green; 2 red, 3 blue, 9 green
Game 48: 2 blue, 4 green; 7 blue, 3 red, 2 green; 17 blue, 13 red; 2 red, 1 green, 9 blue; 2 red, 14 blue
Game 49: 6 red, 2 blue, 3 green; 1 green, 4 blue, 7 red; 5 red, 8 green, 6 blue; 1 red, 9 green
Game 50: 18 red, 4 blue; 6 blue, 3 green, 13 red; 1 green, 7 red, 6 blue
Game 51: 10 blue, 1 green, 9 red; 3 green, 6 blue, 8 red; 4 red, 2 green, 12 blue
Game 52: 7 blue, 1 red, 8 green; 2 red, 9 blue, 8 green; 16 blue, 7 green; 1 red, 11 green, 8 blue; 2 red, 20 blue
Game 53: 8 green, 15 red, 4 blue; 5 green, 13 blue; 6 blue, 6 green, 15 red; 12 blue, 2 green, 2 red
Game 54: 3 green, 5 red, 1 blue; 1 blue, 6 green, 2 red; 4 green, 3 red
Game 55: 12 green, 8 red, 3 blue; 6 blue, 2 red, 7 green; 4 blue, 13 red, 11 green; 12 green, 9 blue, 7 red; 10 red, 6 blue, 3 green
Game 56: 6 red, 1 green, 2 blue; 1 red, 1 green, 3 blue; 12 red, 4 blue, 4 green; 3 green, 5 blue, 1 red; 5 blue, 3 green, 2 red; 1 green, 5 red, 7 blue
Game 57: 1 blue, 1 green, 3 red; 10 red, 6 green, 1 blue; 4 red, 4 green, 2 blue; 7 green, 2 blue, 1 red
Game 58: 5 green, 2 blue, 4 red; 2 red, 2 blue; 5 red, 3 green; 3 blue, 5 green; 6 red, 2 green, 2 blue; 7 red, 3 blue, 5 green
Game 59: 14 red, 9 green; 11 red, 2 blue, 5 green; 18 red, 2 blue, 4 green
Game 60: 16 red, 9 green, 2 blue; 8 green, 17 red; 3 blue, 5 green, 14 red
Game 61: 12 red, 17 blue, 18 green; 1 green, 1 blue; 1 blue, 4 green, 6 red
Game 62: 2 blue, 5 green, 3 red; 1 blue, 7 green, 6 red; 8 blue, 1 red; 4 blue, 5 red, 12 green; 15 blue, 3 green, 1 red
Game 63: 2 blue, 2 red, 1 green; 5 red, 10 blue, 4 green; 4 green, 5 blue, 8 red
Game 64: 2 blue, 14 green; 9 green, 5 red; 7 red, 3 blue, 10 green; 14 green, 2 blue, 5 red
Game 65: 4 green, 7 blue, 1 red; 3 red, 2 green, 7 blue; 5 blue, 2 red, 1 green; 6 blue, 2 green; 7 blue
Game 66: 9 red, 2 green, 5 blue; 5 blue; 8 blue, 5 green, 11 red; 17 blue, 3 green, 14 red; 2 green, 9 blue; 11 red, 4 blue
Game 67: 2 green, 7 red, 8 blue; 6 red, 4 green; 1 red, 3 green, 7 blue; 7 blue, 7 red, 4 green; 2 red, 1 green; 3 green, 6 red, 2 blue
Game 68: 4 red, 2 blue, 5 green; 5 blue, 8 red, 2 green; 11 red, 2 green, 4 blue; 7 red, 5 blue, 3 green
Game 69: 8 blue, 1 green, 4 red; 3 red, 11 blue, 9 green; 12 blue, 10 green; 1 red, 15 blue, 7 green
Game 70: 13 blue, 1 green, 8 red; 15 blue, 10 red; 10 blue, 17 red; 15 red, 4 green, 6 blue; 11 red, 1 blue, 2 green; 14 red, 4 green, 4 blue
Game 71: 1 red, 10 blue; 1 green, 12 blue, 2 red; 4 red, 4 green, 8 blue
Game 72: 2 green, 6 red, 1 blue; 7 red, 4 green, 4 blue; 7 red, 4 blue, 7 green; 7 green, 3 blue; 10 green, 9 blue, 8 red; 5 red, 2 green, 8 blue
Game 73: 8 blue, 2 green, 9 red; 2 green, 10 red, 6 blue; 3 blue, 6 green, 2 red
Game 74: 2 blue, 10 green, 7 red; 4 blue, 13 red, 3 green; 11 green, 3 red, 4 blue
Game 75: 14 green, 1 red, 7 blue; 15 blue, 11 green, 1 red; 11 green, 15 blue, 6 red
Game 76: 7 green, 7 red, 2 blue; 4 blue, 18 red, 9 green; 12 red, 4 blue, 1 green
Game 77: 3 blue, 1 green, 12 red; 10 green, 13 red, 7 blue; 7 green, 12 red; 6 blue, 10 red; 5 blue, 3 green, 17 red; 3 green, 5 blue, 13 red
Game 78: 11 red, 9 blue; 2 red, 7 blue; 12 red, 7 blue, 3 green; 3 green, 8 red, 9 blue; 1 green, 5 red, 6 blue
Game 79: 6 red, 12 blue; 5 red, 4 green, 11 blue; 13 blue, 2 green, 3 red
Game 80: 7 red, 6 blue; 2 green, 7 red, 6 blue; 5 blue, 6 red, 2 green; 1 green, 7 red, 2 blue; 4 green, 6 blue, 7 red; 1 green, 6 red, 10 blue
Game 81: 10 blue, 7 green, 3 red; 7 green, 3 red, 16 blue; 18 blue, 3 red, 7 green
Game 82: 7 red, 5 blue, 9 green; 7 blue, 8 green, 11 red; 1 blue, 1 green, 10 red; 5 red, 8 blue, 7 green; 6 red, 10 green, 2 blue; 3 blue, 5 green, 10 red
Game 83: 2 red, 2 green, 1 blue; 2 green, 2 red; 6 red, 1 green; 8 red, 1 blue, 1 green; 1 red, 1 green; 3 red
Game 84: 9 red, 4 green; 1 red, 13 green, 2 blue; 2 green, 15 red, 2 blue
Game 85: 2 green, 4 red; 1 blue; 2 green, 4 red, 1 blue
Game 86: 2 green, 10 red, 3 blue; 3 red, 5 blue; 3 green, 2 blue, 8 red; 1 blue, 5 red, 2 green
Game 87: 19 green, 9 blue, 7 red; 12 red, 15 green; 4 blue, 8 green; 6 green, 3 red, 11 blue; 16 green, 4 blue, 11 red; 10 red, 4 blue, 9 green
Game 88: 6 red, 2 green; 10 red, 4 green, 4 blue; 1 blue, 8 red, 12 green; 7 green, 2 blue, 12 red; 1 green, 5 blue, 16 red; 10 red, 5 blue
Game 89: 1 red, 14 blue, 1 green; 1 red, 12 blue, 8 green; 2 red, 13 blue, 11 green; 8 blue, 4 red, 16 green; 4 red, 5 blue; 6 blue, 1 red, 1 green
Game 90: 3 blue, 9 green, 5 red; 4 green, 6 red, 1 blue; 2 blue, 12 green, 5 red; 1 green, 1 blue, 3 red; 5 red, 3 green
Game 91: 8 green, 3 blue, 8 red; 8 green, 4 blue, 4 red; 5 red, 1 green
Game 92: 1 green, 9 red; 1 red, 4 blue; 9 red, 2 green; 3 red, 1 blue
Game 93: 1 red, 16 green, 5 blue; 1 red, 1 green, 4 blue; 4 blue, 6 red, 13 green
Game 94: 9 red, 9 blue, 3 green; 5 green, 11 blue, 1 red; 3 red, 6 blue
Game 95: 2 green, 4 blue; 8 green, 2 blue, 12 red; 10 red, 9 green; 4 red, 2 blue, 4 green; 8 blue, 7 green, 14 red; 1 blue, 4 red, 8 green
Game 96: 12 red, 2 blue, 8 green; 6 green, 6 red; 7 blue, 8 green, 6 red; 14 red, 8 green; 2 blue, 4 green, 10 red; 6 green, 7 blue, 7 red
Game 97: 4 green, 12 red, 2 blue; 8 blue, 3 red, 3 green; 2 blue, 2 red, 7 green; 17 blue, 1 green, 7 red; 19 blue, 1 red, 6 green; 6 green, 7 red, 9 blue
Game 98: 13 red, 15 green, 14 blue; 6 blue, 1 green; 14 blue, 12 red, 1 green
Game 99: 1 green, 11 red, 12 blue; 7 red, 20 blue, 1 green; 5 blue, 5 red; 6 blue, 4 red; 1 blue, 1 green; 6 red, 8 blue
Game 100: 2 red, 9 green, 11 blue; 13 blue, 4 red, 16 green; 8 green, 13 blue; 10 green, 1 red, 12 blue