Skip to content

Commit

Permalink
Day_02(2023): I was a bit shortsighted here
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheinxy committed Dec 2, 2023
1 parent 88c1f1e commit e6040c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 2023/Day_02/Day_02.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parseInput = map (map makeCube . matchCube) . lines
makeCube [_, n, "green"] = Green (read n)

partOne :: Input -> Output
partOne = sum . map fst . filter (all id . map validate . snd) . zip [1 .. ]
partOne = sum . map fst . filter (all validate . snd) . zip [1 .. ]
where validate (Blue n) = n <= 14
validate (Green n) = n <= 13
validate (Red n) = n <= 12
Expand Down
2 changes: 1 addition & 1 deletion 2023/Day_02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parseInput = map (map makeCube . matchCube) . lines
makeCube [_, n, "green"] = Green (read n)

partOne :: Input -> Output
partOne = sum . map fst . filter (all id . map validate . snd) . zip [1 .. ]
partOne = sum . map fst . filter (all validate . snd) . zip [1 .. ]
where validate (Blue n) = n <= 14
validate (Green n) = n <= 13
validate (Red n) = n <= 12
Expand Down

0 comments on commit e6040c5

Please sign in to comment.