Skip to content

Instantly share code, notes, and snippets.

@kylefeng
Created June 28, 2013 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylefeng/5886031 to your computer and use it in GitHub Desktop.
Save kylefeng/5886031 to your computer and use it in GitHub Desktop.
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