def combinations(occurrences: List[(Char,Int)]): List[List[(Char,Int)]] = occurrences match {
case Nil => Nil
case x :: xs => for(z <- combinations(xs); y <- occ(x)) yield (y :: z)
}
def occ(e: (Char, Int)): List[(Char, Int)] = (for(i <- 0 to e._2) yield (e._1, i)).toList
Hi,
I can't find any flaw in the above snippet but it still giving me List() for any input.