Skip to content

Instantly share code, notes, and snippets.

@plaster
Created December 9, 2012 16:18
Show Gist options
  • Save plaster/4245866 to your computer and use it in GitHub Desktop.
Save plaster/4245866 to your computer and use it in GitHub Desktop.
Problem 1
(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))))
@tnoda
Copy link

tnoda commented Dec 11, 2012

@kohyama のコメントを見る前だったので,なんだか同じようなことも書いていますが,私は (apply + coll) 派ですね. > http://tnoda-clojure.tumblr.com/post/37700304493/apply-and-reduce (@ponkore 版解答のコメントに貼ったのと同じ URL)

@tnoda
Copy link

tnoda commented Dec 11, 2012

@plaster https://gist.github.com/4245866#gistcomment-621381apply/my-* 実験分かりやすくて参考になりました.apply に渡す関数の作り方の勉強にもなりました.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment