Q:

How to generate array of tuples from a list in scala?

I have a row as below (Int,List(String))
(22,List(B00000JCDS, B000004CSZ, B00016XN6Q, B00005LLY3, B00023B1UI))

I need to generate a tuple array or any other collection as below:
(22,B00000JCDS)
(22,B000004CSZ)
(22,B00016XN6Q)
(22,B00005LLY3)
(22,B00023B1UI)

How to generate this dataset in Scala?

A:

scala> a._2.map((a._1,_))
res3: List[(Int, String)] = List((22,B00000JCDS), (22,B000004CSZ), (22,B00016XN6Q), (22,B00005LLY3), (22,B00023B1UI))

where a is (22,List(B00000JCDS, B000004CSZ, B00016XN6Q, B00005LLY3, B00023B1UI))

