Skip to content

Instantly share code, notes, and snippets.

@kylefeng
Created June 28, 2013 16:31

Revisions

  1. kylefeng created this gist Jun 28, 2013.
    5 changes: 5 additions & 0 deletions gistfile1.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    (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]])