Skip to content

Instantly share code, notes, and snippets.

@miner miner/lucky.clj
Created Feb 23, 2015

What would you like to do?
(ns miner.lucky
(:require [ :as avl]))
(defn lucky-avl
([max] (lucky-avl 1 (apply avl/sorted-set (range 1 max 2))))
([i avl]
(let [n (nth avl i nil)]
(if (and n (<= n (count avl)))
(recur (inc i) (reduce (fn [sss m] (disj sss (nth avl m)))
(range (dec n) (count avl) n)))
(sequence avl)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.