diff --git a/3-b-v2.hs b/3-b-v2.hs index 41e8be0..d8b2366 100644 --- a/3-b-v2.hs +++ b/3-b-v2.hs @@ -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 \ No newline at end of file