2015-12-16 183 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)}}