pedantic
parent
08a37af729
commit
224c8cf70c
|
@ -17,9 +17,9 @@ threeDigitProducts = [ n*m | n <- [100..999], m <- [n..999] ]
|
||||||
isPalindrome :: Integer -> Bool
|
isPalindrome :: Integer -> Bool
|
||||||
isPalindrome n = all (== True) $ zipWith (==) half half'
|
isPalindrome n = all (== True) $ zipWith (==) half half'
|
||||||
where
|
where
|
||||||
(half, half'') = splitAt h n'
|
(half, half'') = splitAt l n'
|
||||||
half' = reverse half''
|
half' = reverse half''
|
||||||
h = length n' `div` 2
|
l = length n' `div` 2
|
||||||
n' = show n
|
n' = show n
|
||||||
-- n' = trace (show n) $ show n
|
-- n' = trace (show n) $ show n
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue