Guest User

What is better?: factorial

a guest
Nov 13th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. My solution:
  2. --------------------
  3.  
  4. (fn [n]
  5.   (loop [k n v 1]
  6.     (if (= 1 k)
  7.       v
  8.       (recur (dec k) (* v k)))))
  9.  
  10. someone elses solution
  11. ---------------------------
Advertisement
Add Comment
Please, Sign In to add comment