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 [l1, l2, l3] = only $ l1 `intersect` l2 `intersect` l3
|
||||||
findDuplicate _ = undefined
|
findDuplicate _ = undefined
|
||||||
|
|
||||||
extractIntoGroups :: Int -> [String] -> [[String]]
|
|
||||||
extractIntoGroups s l
|
|
||||||
| s > length l = []
|
|
||||||
| otherwise = take s l : extractIntoGroups s (drop s l)
|
|
||||||
|
|
||||||
main = interact $
|
main = interact $
|
||||||
show . sum
|
show . sum
|
||||||
. map (getCharPriority . findDuplicate)
|
. map (getCharPriority . findDuplicate)
|
||||||
. extractIntoGroups 3
|
. chunkList 3
|
||||||
. lines
|
. lines
|
Loading…
Reference in New Issue