forgot full listing:
scala> List[Int](6, 7, 8, 1, 2, 3, 4, 1, 11, 10 ,11 ,12 ,13,
| 3).foldLeft(List[List[Int]]()){(a,b)=>
| if(a.isEmpty) List(List(b))
| else if(a.last.last < b) a.dropRight(1):::List(a.last:+b)
| else a:::List(List(b))
|
}.filter(_.length>1).foldLeft(List[Int]()){(a,b)=>if(a.length>=b.length)
| a else b}
res0: List[Int] = List(1, 2, 3, 4)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en