1
0
Fork 0
advent-of-code/2020/05/part2.hs
Zach Perrault 0e931fe431
solve: day 5
- solve: day 5, part 1
 - solve: day 5, part 2
2020-12-05 11:09:41 -05:00

14 lines
307 B
Haskell
Executable file

#!/usr/bin/env runghc
import Day5
import Data.List
main = interact solve
solve = show . mySeat . map (seatId . read) . lines
mySeat input = mySeat'
where
boardingPasses = sort input
start = head boardingPasses
mySeat' = fst . head . dropWhile (uncurry (==)) $ zip [start..] boardingPasses