Created
December 9, 2012 16:18
-
-
Save plaster/4245866 to your computer and use it in GitHub Desktop.
Problem 1
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
(use 'clojure.set) | |
(defn n-multiples [n end] (set (range 0 end n))) | |
(defn solve [] | |
(apply + (union (n-multiples 3 1000) | |
(n-multiples 5 1000)))) |
@plaster https://gist.github.com/4245866#gistcomment-621381 の apply
/my-*
実験分かりやすくて参考になりました.apply
に渡す関数の作り方の勉強にもなりました.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kohyama のコメントを見る前だったので,なんだか同じようなことも書いていますが,私は
(apply + coll)
派ですね. > http://tnoda-clojure.tumblr.com/post/37700304493/apply-and-reduce (@ponkore 版解答のコメントに貼ったのと同じ URL)