Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Created September 3, 2016 03:47
Show Gist options
  • Select an option

  • Save chrisbodhi/a20fc64ef31ff4d6e8910b8842d1b886 to your computer and use it in GitHub Desktop.

Select an option

Save chrisbodhi/a20fc64ef31ff4d6e8910b8842d1b886 to your computer and use it in GitHub Desktop.
(defn factorial
"Returns the factorial of the supplied number"
[n]
(reduce * (into [] (range 1 (inc n)))))
(factorial 5)
; => 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment