From 61958979c682ec4bb333013d29afbb07ecdd68cf Mon Sep 17 00:00:00 2001 From: shu Date: Wed, 4 Dec 2019 08:16:15 +0100 Subject: [PATCH] Why reimplement show --- 2019/day4/day4.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/2019/day4/day4.hs b/2019/day4/day4.hs index bc5fd91..0c36f2f 100644 --- a/2019/day4/day4.hs +++ b/2019/day4/day4.hs @@ -10,7 +10,7 @@ day4a bottom top = dumbbrute bottom top p 0 day4b bottom top = dumbbrute bottom top p' 0 dumbbrute x y p acc - | x'<=y = dumbbrute x' y p (if p (numexpl x) then acc+1 else acc) + | x'<=y = dumbbrute x' y p (if p $ show x then acc+1 else acc) | otherwise = acc where x' = succ x @@ -23,6 +23,3 @@ p' x | sort x /= x = False | 2 `elem` (map length $ group x) = True | otherwise = False - -numexpl 0 = [] -numexpl x = numexpl (x `div` 10) ++ [x `mod` 10]