Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def combinations(occurrences: Occurrences): List[Occurrences] = occurrences match {
- case Nil => List(Nil)
- case x::xs => {
- combinations( xs ) ::: (for ( other <- combinations( xs ); i <- 1 to x._2 ) yield ( x._1, i )::other)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement