1
0
Fork 0
advent-of-code/2020/01/part2.hs
2022-09-21 09:19:52 -04:00

16 lines
304 B
Haskell
Executable file

#!/usr/bin/env runghc
import Data.List
import Data.Maybe
main = interact findSolution
findSolution = show . product . findJust isSolutionTriple . triples . parseInput
parseInput = map read . lines
triples = sequence . replicate 3
isSolutionTriple = (2020 ==) . sum
findJust f = fromJust . find f