title: Pop Last element from a list Scala
body: <p>I'm trying to find the most efficient way to pop an element from a <code>List[Map[String, String]]</code> in scala.</p>
  
  <p>What I want is something like this:</p>
  
  <pre><code>val last = myList.pop
  </code></pre>
  
  <p>Here last should have the last element and myList should have everything but last.</p>
  
  <p>I can do this in two operations using last and init but that would require two linear operations. How can i avoid this?</p>