1
0
Fork 0
advent-of-code/2020/01/part1.hs
2020-12-01 01:58:49 -05:00

16 lines
295 B
Haskell
Executable file

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