Created
September 3, 2015 10:34
-
-
Save ajrouvoet/92d6b4d397b9751b83e4 to your computer and use it in GitHub Desktop.
Q1 Devv Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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