You are viewing a single comment's thread. Return to all comments →
import Data.List(intercalate) rotatedStrings :: String -> String rotatedStrings a = intercalate " " $ stringRotations a stringRotations :: String -> [String] stringRotations s = [rotate i s | i <- [1.. length s] ] where rotate i s = drop i s ++ take i s main :: IO () main = do _ <- getLine interact (unlines . map rotatedStrings . lines)
Seems like cookies are disabled on this browser, please enable them to open this website
Rotate String
You are viewing a single comment's thread. Return to all comments →