You are viewing a single comment's thread. Return to all comments →
Haskell, point-free solution:
module Main where import Control.Monad (ap, replicateM_) import Data.Char (ord) solve :: String -> Int solve = flip div 2 . sum . ap (zipWith ((abs .) . subtract)) reverse . map ord main :: IO () main = readLn >>= flip replicateM_ (getLine >>= print . solve)
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →
Haskell, point-free solution: