2015-12-16 233 views

回答

1

試試這個:

A.flatMap { case (first, dbls) => dbls.zipWithIndex.map { case (dbl, ix) => (first, ix.toLong, dbl) } } 
1

你可以這樣來做:

A.flatMap {case (v, arr) => arr.zipWithIndex.map {case (a, i) => (v, i, a)}}