Advertisement
Guest User

AGDSG

a guest
Jun 16th, 2014
179
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] =
  2.     if ( occurrences.isEmpty ) List()
  3.     else      
  4.       for ( result <- combinations( occurrences.tail ); i <- 1 to occurrences.head._2 ) yield ( occurrences.head._1, i )::result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement