Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rotate :: [a] -> Int -> [a]
- rotate list n = realRotate list [] n
- where realRotate (x:xs) ys n
- | n == 0 = (x:xs) ++ ys
- | otherwise = realRotate xs (ys ++ [x]) (pred n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement