Ad
Code
Diff
  • module AreThereThree where
    
    solution :: Int -> Bool
    solution 0 = False
    solution x = y == 3 || solution x'
      where (x', y) = divMod (abs x) 10
    • module AreThereThree where
    • solution :: Int -> Bool
    • solution = go . abs
    • where
    • go 0 = False
    • go x = let (x', y) = x `divMod` 10 in y == 3 || go x'
    • solution 0 = False
    • solution x = y == 3 || solution x'
    • where (x', y) = divMod (abs x) 10