title: how to iterate over list of lists in scala
body: <p>I want to iterate over a <code>list[List[String]]</code> to subset it into a <code>list[String]</code> and then store each list from the list of lists in a <code>val</code>. The val's name could be anything but it should include each list index in its name.</p>
  
  <p>For example: </p>
  
  <pre><code> val x: List[ List[String]] = List(List("Nike","Apple"), List("James", "Mike"))
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code> group_0 : List[String] = List(Nike, Apple)
   group_1 = List[String] = List(James, Mike)
  </code></pre>