Skip to content

Instantly share code, notes, and snippets.

@dosbol
Created September 6, 2016 20:48
Show Gist options
  • Save dosbol/3b07e6a3e28817a1c578b6503791ff8e to your computer and use it in GitHub Desktop.
Save dosbol/3b07e6a3e28817a1c578b6503791ff8e to your computer and use it in GitHub Desktop.
(def input "xyzzy | yzzy
afbbbfjdjklgdfdhfdkjfffhhfffjkdfhdhkyejejfjkd | dhfdkjfffhhfffjkdfhd
bartarcarracecarbartar | racecar
3.1415926535897932384626433832795028841971 | 46264")
(defn polindrome? [x]
(= (reverse s) (seq s)))
(defn splt [s]
(clojure.string/split s #"\n| | "))
(->> input
(splt)
(filter polindrome?)
(sort-by count)
(last))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment