Formatting
parent
68226c0057
commit
cabaf3f321
|
@ -3,15 +3,15 @@
|
||||||
import Debug.Trace (trace)
|
import Debug.Trace (trace)
|
||||||
|
|
||||||
twoDigitProducts :: [Integer]
|
twoDigitProducts :: [Integer]
|
||||||
twoDigitProducts = [ n*m | n <- [10..99], m <- [n..99] ]
|
twoDigitProducts = [ n*m | n <- [10..99], m <- [n..99] ]
|
||||||
|
|
||||||
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 h n'
|
||||||
half' = reverse half''
|
half' = reverse half''
|
||||||
h = length n' `div` 2
|
h = length n' `div` 2
|
||||||
n' = show n
|
n' = show n
|
||||||
-- n' = trace (show n) $ show n
|
-- n' = trace (show n) $ show n
|
||||||
|
|
||||||
solve :: Integer
|
solve :: Integer
|
||||||
|
|
Loading…
Reference in New Issue