Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2012 00:15
Show Gist options
  • Save anonymous/2765605 to your computer and use it in GitHub Desktop.
Save anonymous/2765605 to your computer and use it in GitHub Desktop.
;; jbochi's solution to Least Common Multiple
;; https://4clojure.com/problem/100
(fn [& s]
(reduce
(fn lcm [a b] (/
(* a b)
((fn gcd [a b]
(if (= b 0)
a
(gcd b (mod a b)))) a b)))
s))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment