You are viewing a single comment's thread. Return to all comments →
Haskell
module Main where import Control.Monad (replicateM_) import Data.Char (ord) cDif :: Char -> Char -> Int cDif x y = abs (ord x - ord y) sDif :: String -> [Int] sDif s = zipWith cDif s (tail s) solve :: String -> String solve s | sDif s == sDif (reverse s) = "Funny" | otherwise = "Not Funny" main :: IO () main = do cases <- readLn :: IO Int replicateM_ cases $ do s <- getLine :: IO String putStrLn $ solve s
Seems like cookies are disabled on this browser, please enable them to open this website
Funny String
You are viewing a single comment's thread. Return to all comments →
Haskell