Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (9 sloc) 180 Bytes
; P03 Find the Kth element of a list.
; Tail recursion
(defn f1 [l, n]
(if (= n 1)
(first l)
(recur (rest l) (dec n))))
; Using index
(defn f2 [l, n]
(nth l (dec n)))