Created
May 17, 2011 01:19
-
-
Save kartikshah/975699 to your computer and use it in GitHub Desktop.
4Clojure - 44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn rotate [n xs] | |
(let [cnt (count xs) | |
modn (mod n cnt)] | |
(flatten (list (take-last (- cnt modn) xs) (take modn xs))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment