You are viewing a single comment's thread. Return to all comments →
Here is my haskell solution. I'm actually a bit proud of how short the code turned out to be
rotations :: String -> [String] rotations s = take (length s) $ tail $ iterate (\x -> tail x ++ [head x]) s main = getContents >>= putStrLn . unlines . map (unwords . rotations) . tail . lines
Rotate String
You are viewing a single comment's thread. Return to all comments →
Here is my haskell solution. I'm actually a bit proud of how short the code turned out to be