main :: IO ()
main = do
print $ part1 puzzleKey
+ print $ part2 puzzleKey
-- part1 :: String -> Int
-- part1 key = sum rowCounts
-- part2 :: String -> Int
-part2 key = cells
+part2 key = length $ cellEdges cells
where binHashes = map binHash $ rowSpecs key
cells = presentCells binHashes
-- isPresent rc = length $ rc `member` cells
-cellEdges :: CellMap -> Int
-cellEdges cells = length $ G.stronglyConnComp [(k, numKey k, map numKey $ adjacentCells cells k) | k <- M.keys cells]
+-- cellEdges :: CellMap -> Int
+cellEdges cells = G.stronglyConnComp [(k, numKey k, map numKey $ adjacentCells cells k) | k <- M.keys cells]
rowSpecs :: String -> [String]
rowSpecs key = map (((key ++ "-") ++) . show) [0..127]
densify ns = codes
where chunks = chunksOf 16 ns
compress = foldl1 xor
- codes = map compress chunks
\ No newline at end of file
+ codes = map compress chunks