Why reimplement show

This commit is contained in:
shu 2019-12-04 08:16:15 +01:00
parent a07b6fba16
commit 61958979c6

View File

@ -10,7 +10,7 @@ day4a bottom top = dumbbrute bottom top p 0
day4b bottom top = dumbbrute bottom top p' 0 day4b bottom top = dumbbrute bottom top p' 0
dumbbrute x y p acc 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 | otherwise = acc
where x' = succ x where x' = succ x
@ -23,6 +23,3 @@ p' x
| sort x /= x = False | sort x /= x = False
| 2 `elem` (map length $ group x) = True | 2 `elem` (map length $ group x) = True
| otherwise = False | otherwise = False
numexpl 0 = []
numexpl x = numexpl (x `div` 10) ++ [x `mod` 10]