chunkList exists, apparently
This commit is contained in:
parent
94f3e04fbd
commit
c57fa1df31
|
@ -13,13 +13,8 @@ findDuplicate :: [String] -> Char
|
|||
findDuplicate [l1, l2, l3] = only $ l1 `intersect` l2 `intersect` l3
|
||||
findDuplicate _ = undefined
|
||||
|
||||
extractIntoGroups :: Int -> [String] -> [[String]]
|
||||
extractIntoGroups s l
|
||||
| s > length l = []
|
||||
| otherwise = take s l : extractIntoGroups s (drop s l)
|
||||
|
||||
main = interact $
|
||||
show . sum
|
||||
. map (getCharPriority . findDuplicate)
|
||||
. extractIntoGroups 3
|
||||
. chunkList 3
|
||||
. lines
|
Loading…
Reference in New Issue