title: Scala flatten nested map
body: <p>I have a nested Map like this one:</p>
  
  <pre><code>Map(1 -&gt; Map(2 -&gt; 3.0, 4 -&gt; 5.0), 6 -&gt; Map(7 -&gt; 8.0))
  </code></pre>
  
  <p>I would like to 'flatten' it in a way such that the keys of the outer and inner maps are paired, i.e. for the example above:</p>
  
  <pre><code>Seq((1,2),(1,4),(6,7))
  </code></pre>
  
  <p>what is an elegant way to do this?</p>