Created
June 16, 2011 01:51
-
-
Save amalloy/1028531 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
(let [data [14 6 43 195 3214 31], [init more] (split-at 2 data)] | |
(reduce (fn [[x y] n] | |
(cond (< n y) [x y] | |
(< n x) [x n] | |
:else [n x])) | |
(reverse (sort init)) | |
more)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment