Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import System.Environment
- l v = f (reverse v) - 1
- where
- f ([]) = 0
- f (x:xs) = (nmap x + 1) + baseLen * f xs
- nmap x = fromJust $ lookup x $ zip base [0..]
- base = ['a'..'z']
- baseLen = length base
- main :: IO ()
- main = do
- (v:_) <- getArgs
- print $ l v
Add Comment
Please, Sign In to add comment