feat(haskell): add persistent bugger
This commit is contained in:
commit
2e43ff0c6b
1 changed files with 6 additions and 0 deletions
6
haskell/1_persistent_bugger.hs
Normal file
6
haskell/1_persistent_bugger.hs
Normal file
|
@ -0,0 +1,6 @@
|
|||
import Data.Char(digitToInt)
|
||||
|
||||
persistence :: Int -> Int
|
||||
persistence n
|
||||
| n < 10 = 0
|
||||
| otherwise = 1 + persistence (product $ map digitToInt $ show n)
|
Loading…
Add table
Reference in a new issue