Skip to content

Instantly share code, notes, and snippets.

@dmalikov
Created November 27, 2011 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmalikov/1398076 to your computer and use it in GitHub Desktop.
Save dmalikov/1398076 to your computer and use it in GitHub Desktop.
Project Euler 89 (0.02 s)
import Roman
import System.Environment
import Data.Char (toUpper)
import Control.Arrow ((&&&))
redundantChars :: String -> Int
redundantChars = (\(x,y) -> length x - length y) . (id &&& (toRoman . fromRoman))
main = do
romans <- getContents
print . sum . map redundantChars . lines $ romans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment