-
-
Save anonymous/1af8da56680808458d7d to your computer and use it in GitHub Desktop.
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
(ns my-stuff.core | |
(:gen-class)) | |
(defn isAnagram? | |
[firstWord secondWord] | |
(letfn [(clean [word] (apply str (filter #(Character/isLetter %) word)))] | |
(if (= (sort (clean firstWord)) (sort (clean secondWord))) | |
(println "Anagram") | |
(println "Not an anagram")))) | |
(defn -main | |
[& args] | |
(if (= (count args) 2) | |
(isAnagram? (first args) (second args)) | |
(println "Usage: <first word> <second word>"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment