#108
Lazy Searching
 

Difficulty:Medium
Topics:seqs sorting


Given any number of sequences, each sorted from smallest to largest, find the smallest single number which appears in all of the sequences. The sequences may be infinite, so be careful to search lazily.
test not run
(= 3 (__ [3 4 5]))
test not run
(= 4 (__ [1 2 3 4 5 6 7] [0.5 3/2 4 19]))
test not run
(= 64 (__ (map #(* % % %) (range))
                                 (filter #(zero? (bit-and % (dec %))) (range))
                                 (iterate inc 20)))
test not run
(= 7 (__ (range) (range 0 100 7/6) [2 3 5 7 11 13]))


Code which fills in the blank: