graveyard/aoc2020/6.hs
2022-05-09 11:58:15 -05:00

12 lines
305 B
Haskell

import Data.List
import Data.List.Split
readlines :: FilePath -> IO [String]
readlines = fmap (splitOn "\n\n" . init) . readFile
solution2 :: [[String]] -> Int
solution2 = sum . (map $ length . foldr1 intersect)
main = do
input <- readlines "6.txt"
print (solution2 $ map (splitOn "\n") input)