Sum of the digits of n is substring of n: Difference between revisions
Content deleted Content added
Line 102:
main :: IO ()
main =
mapM_ putStrLn $
showMatches digitSumIsSubString <$> [999, 10000]
showMatches :: (String -> Bool) -> Int -> String
showMatches p limit =
( show (length xs)
<> " matches in [0.."
Line 117 ⟶ 118:
<> "\n"
where
xs = filter p $ fmap show [0 .. limit]▼
▲ fmap show [0 .. limit]
w = length (last xs)
|