graveyard/aoc2020/6.hs

13 lines
305 B
Haskell
Raw Permalink Normal View History

2022-05-09 16:58:15 +00:00
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)