Enumerate k-combinations in Clojure (P26 from 99 problems)
I'm currently reading "Joy of Clojure" so I'm (very) far from being "fluent" in Clojure but what I noticed is:


your solution is clever but quite complicated, you use "imperative" habits like indexed iteration
try to keep with simple abstractions like sequence first and rest and the solution will work with any Clojure collection - see example below
your solution use cond with three checks for k - consider using condp


Here's my code:

(defn subsets [n items]
(cond
    (= n 0) '(())
    (empty? items) '()
    :else (concat (map
                    #(cons (first items) %)
                    (subsets (dec n) (rest items)))
                  (subsets n (rest items)))))