title: python - merge two lists but keep same number of occurrences
body: <p>I have a problem that I could not find a good answer for:
  I want to merge two lists but keep the same number of occurrences from each object
  EX:</p>
  
  <pre><code>list1 = [2,3,7]
  list2 = [2,2,5]
  </code></pre>
  
  <p>After merging thees two lists the result should look like this:</p>
  
  <pre><code>res = [2,2,3,5,7] #it does not need to be sorted
  </code></pre>
  
  <p>Observe that from the beginning there was together three "2" but after merging there should only be two "2"</p>
  
  <p>The closest I have found is in this post: <a href="https://stackoverflow.com/questions/1319338/combining-two-lists-and-removing-duplicates-without-removing-duplicates-in-orig">Combining two lists and removing duplicates, without removing duplicates in original list</a></p>
  
  <p>but this does not work the way I want it.</p>
  
  <p>an other example:</p>
  
  <pre><code>l1 = [2]
  l2 = [3]
  l3 = [2,2]
  l4 = [5]
  l5 = [2,3]
  
  #after adding all the lists above
  result = [2,2,3,5]
  </code></pre>