Skip to content

Commit a590a7e

Browse files
committed
Add 1.9 using clojure
1 parent 0966c0d commit a590a7e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(defn +++ [a b]
2+
(if (= a 0)
3+
b
4+
(inc (+ (dec a) b))))
5+
6+
(defn ++ [a b]
7+
(if (= a 0)
8+
b
9+
(++ (dec a) (inc b))))
10+
11+
; recursive
12+
(= 9 (+++ 4 5))
13+
; iterative
14+
(= 9 (++ 4 5))

0 commit comments

Comments
 (0)