-
-
Save amalloy/8ef871f0d800e6e692db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user> (take-while seq | |
(map first | |
(rest | |
(let [fits? (fn [a b] (>= 4 (Math/abs (- a b))))] | |
(iterate (fn [[_ [first :as coll]]] | |
(split-with (partial fits? first) coll)) | |
[nil '(1 2 3 4 5 6 7 7 7 7 7 7 9 10)]))))) | |
((1 2 3 4 5) (6 7 7 7 7 7 7 9 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment