You are viewing a single comment's thread. Return to all comments →
Haskell
module Main where import Control.Monad (replicateM_) solve :: String -> String solve = go "hackerrank" where go [] _ = "YES" go _ [] = "NO" go (x : xs) (y : ys) | x == y = go xs ys | otherwise = go (x : xs) ys main :: IO () main = do n <- readLn :: IO Int replicateM_ n $ getLine >>= putStrLn . solve
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
Haskell