6 hs
This commit is contained in:
parent
75f30d2389
commit
7e3af57f53
1 changed files with 12 additions and 0 deletions
12
6.hs
Normal file
12
6.hs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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)
|
Loading…
Reference in a new issue