Skip to content

Instantly share code, notes, and snippets.

@swuecho
Created July 24, 2012 20:45
Show Gist options
  • Select an option

  • Save swuecho/3172556 to your computer and use it in GitHub Desktop.

Select an option

Save swuecho/3172556 to your computer and use it in GitHub Desktop.
80_easy_anagrams
(ns playground.core)
;;http://www.reddit.com/r/dailyprogrammer/comments/x0v3e/7232012_challenge_80_easy_anagrams/
(defn anagrams? [x y]
(and (= (sort x) (sort y))
(not= x y)))
(defn anagrams [x]
(filter #(anagrams? (.toLowerCase x) %) dict))
(def dict (clojure.string/split-lines
(slurp
(java.io.FileReader. "/home/echo/Documents/dailyprogrammer/Anagrams_80.txt"))))
(anagrams "TRIANGLE")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment