Skip to content

Instantly share code, notes, and snippets.

@aomoriringo
Created August 8, 2012 22:37
Show Gist options
  • Save aomoriringo/3299467 to your computer and use it in GitHub Desktop.
Save aomoriringo/3299467 to your computer and use it in GitHub Desktop.
Project Euler Problem 4 with Haskell
import Data.List (foldl')
isPalindrome :: Integer -> Bool
isPalindrome x = show x == reverse (show x)
main = do
print $ foldl' max 0 [ a*b | a<-[100..999], b<-[100..999], isPalindrome (a*b) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment