part1 :: Wires -> Device -> Int
part1 wires device = wiresOutput $ simulate wires device
+part2 :: String
part2 = intercalate "," $ sort ["vss", "z14", "kdh", "hjf", "z31", "kpp", "z35", "sgj"]
--- Writeup at https://work.njae.me.uk/2024/12/25/advent-of-code-2024-day-23/
+-- Writeup at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-25/
import AoC
compatible (Lock ls) (Key ks) = all (<= 5) $ zipWith (+) ls ks
makeSchematics :: String -> ([Schematic], [Schematic])
-makeSchematics = partition isLock . fmap makeSchematic . splitTexts . lines
+makeSchematics = partition isLock . fmap makeSchematic . splitOn [""] . lines
where isLock (Lock _) = True
isLock _ = False
-splitTexts :: [String] -> [[String]]
-splitTexts = splitOn [""]
-
makeSchematic :: [String] -> Schematic
makeSchematic ss
| isKeySchematic ss = Key $ heightsOf ss