Created
June 22, 2013 14:17
-
-
Save boxp/5841032 to your computer and use it in GitHub Desktop.
clojureでproject-eulerに挑戦 〜四問目〜
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
(defn palindromic? [number] | |
(loop [numseq (seq (str number))] | |
(cond (<= (count numseq) 1) true | |
(= (first numseq) (last numseq)) (recur (drop-last (rest numseq))) | |
:else false))) | |
(def thdigits | |
(range 100 1000)) | |
(println (last (sort (filter palindromic? (for [x thdigits y thdigits] (* x y)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment