13 lines
305 B
Haskell
13 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)
|