chunkList exists, apparently

This commit is contained in:
Jill 2022-12-04 09:23:30 +03:00
parent 94f3e04fbd
commit c57fa1df31
1 changed files with 1 additions and 6 deletions

View File

@ -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