:import std/Combinator . :import std/String . :import std/Number . :import std/Char C :import std/Pair P self [[((zip 0) ∘ (drop 1) ∘ cycle) 0]] ⧗ Number → (List Number) → (List (Pair Number Number)) part1 sum ∘ eqs ∘ pairs sum foldl [[^0 + 1]] (+0) eqs filter (P.uncurry …=?…) pairs self (+1) part2 [(sum ∘ eqs ∘ pairs) 0] sum foldl [[^0 + 1]] (+0) eqs filter (P.uncurry …=?…) pairs self /²(length 0) :test (part1 ((+1) : ((+1) : ((+2) : {}(+2))))) ((+3)) main [parts nums] nums C.char→number <$> ^(lines 0) parts [(part1 0) : (part2 0)]