module Problem41 where

import Control.Applicative
import Data.Char
import Prime

main :: IO ()
main = print . maximum . filter isPandigital $ getPrimesUpto 7654321

isPandigital :: Int -> Bool
isPandigital n = and $ liftA2 elem ['1' .. (chr $ ord '0' + length n')] [n']
    where n' = show n
