title: Merge Scala Seq
body: <p>I have following Seq as input:</p>
  
  <pre><code>Seq(Seq(1,2),Seq(2,3),Seq(3,4),Seq(7,8),Seq(8,9))
  </code></pre>
  
  <p>I would like to create another Seq from this like below:</p>
  
  <pre><code>Seq(Seq(1,4),Seq(7,9))
  </code></pre>
  
  <p>I thought to use sliding operation (take 2) and merge as set to remove duplicates but I am not sure how to achieve it using Seq as it is immutable. Can someone help me?</p>