You are viewing a single comment's thread. Return to all comments →
digSum :: Integer -> Integer digSum x | x < 9 = x | otherwise = digSum $ x `mod` 10 + x `div` 10 findSum :: [Integer] -> Integer findSum n = digSum $ y * digSum x where x = head n y = head $ tail n solve = findSum . map read . words main = interact $ show . solve
why would this not work for test case 9 ?
Seems like cookies are disabled on this browser, please enable them to open this website
Super Digit
You are viewing a single comment's thread. Return to all comments →
why would this not work for test case 9 ?