Created
January 11, 2014 13:37
-
-
Save fbiville/8371036 to your computer and use it in GitHub Desktop.
Can you guess what it does? (Improvement suggestions are welcome ofc)
This file contains 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
(fn mysteryFunction [s] | |
((fn append [mySeq acc] | |
(let [beginning (butlast mySeq)] | |
(if (= beginning nil) | |
(conj acc (first mySeq)) | |
(append beginning (conj acc (last mySeq))) | |
) | |
) | |
) s []) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(some obvious Clojure.core functions were not allowed for this exercise ;-)).