Advertisement
Guest User

adsfadsf

a guest
Jun 16th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.25 KB | None | 0 0
  1. def combinations(occurrences: Occurrences): List[Occurrences] = occurrences match {
  2.     case Nil   => List(Nil)
  3.     case x::xs => {
  4.       combinations( xs ) ::: (for ( other <- combinations( xs ); i <- 1 to x._2 ) yield ( x._1, i )::other)
  5.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement