Skip to content

Commit

Permalink
use gather
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 15, 2023
1 parent 8b07c2f commit 999579c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solutions/src/2023/06.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import Advent (format, binSearchLargest)
-- 33875953
main :: IO ()
main =
do (times, distances) <- [format|2023 6 Time:( +%s)*%nDistance:( +%s)*%n|]
let input1 = zip (map read times) (map read distances)
input2 = (read (concat times), read (concat distances))
do (times, distances) <- [format|2023 6 Time:( +%d!)*%nDistance:( +%d!)*%n|]
let input1 = zip (map snd times) (map snd distances)
input2 = (read (concatMap fst times), read (concatMap fst distances))
print (product (map ways input1))
print (ways input2)

Expand Down

0 comments on commit 999579c

Please sign in to comment.