Skip to content

Instantly share code, notes, and snippets.

@yedi yedi/palin Secret
Created Dec 1, 2011

Embed
What would you like to do?
yedi's palindrome solution
((fn palin [x]
(if
(empty? (seq [x]))
true
(if (= (first (seq x)) (last (seq x)))
(and true (palin (rest (butlast (seq x)))))
false))) [1 2 3 2 1])
((fn palin [x]
(if
(empty? (seq [x]))
true
(if (= (first (seq x)) (last (seq x)))
(and true (palin (rest (butlast (seq x)))))
false))) "racecar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.