aboutsummaryrefslogtreecommitdiff
path: root/challenge-250/deadmarshal/haskell/ch2.hs
blob: d10a85d7c2d1d1098d51157d38cedaab2d451c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Ch2 where

import Data.Char (isDigit)

alphanumericStringValue :: [String] -> Int
alphanumericStringValue xs =
  maximum $ map (\x -> if all isDigit x then read x :: Int else length x) xs
    
main :: IO ()
main = do
  print $ alphanumericStringValue ["perl","2","000","python","r4ku"]
  print $ alphanumericStringValue ["001","1","000","0001"]