feat(haskell): add persistent bugger

This commit is contained in:
Dmitriy Pleshevskiy 2021-10-28 23:50:18 +03:00
commit 2e43ff0c6b
1 changed files with 6 additions and 0 deletions

View 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)