Skip to content

Instantly share code, notes, and snippets.

@ajrouvoet
Created September 3, 2015 10:34
Show Gist options
  • Save ajrouvoet/92d6b4d397b9751b83e4 to your computer and use it in GitHub Desktop.
Save ajrouvoet/92d6b4d397b9751b83e4 to your computer and use it in GitHub Desktop.
Q1 Devv Challenge
import Data.Char
main :: IO ()
main = do
putStrLn $ show . length $ filter reversible [0..100000000]
where
reversible n = (srn !! 0 /= '0') && all (\x -> (digitToInt x) `mod` 2 == 1 ) (show (n + read srn))
where
srn = reverse (show n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment