模拟nth函数
Write a function which returns the Nth element from a sequence.
用递归试了下可以通过
(fn d [seq x]
(if (> x 0)
(d (rest seq) (dec x))
(first seq)))
模拟nth函数
Write a function which returns the Nth element from a sequence.
用递归试了下可以通过
(fn d [seq x]
(if (> x 0)
(d (rest seq) (dec x))
(first seq)))