mykatas/haskell/1_persistent_bugger.hs

7 lines
157 B
Haskell
Raw Normal View History

2021-10-28 23:50:18 +03:00
import Data.Char(digitToInt)
persistence :: Int -> Int
persistence n
| n < 10 = 0
| otherwise = 1 + persistence (product $ map digitToInt $ show n)