Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Solve this problem: http://v2ex.com/t/74002
(for [col (partition-by #(> (second %) 0) (map-indexed vector lst))
:when (every? #(> (second %) 0) col)]
[(count col) [(first (first col)) (first (last col))]])
;user> ([3 [3 5]] [8 [11 18]] [7 [24 30]] [6 [36 41]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment