title: Counting the number of duplicate key values in a map
body: <p>I have a map I have constructed. It iterates through a huge WAPI reply in XML format and creates this map. For each name I want to grab the name, then the total number of matching carrierpairs, then the cheapest price for that name.</p>
  
  <p>So based on below the result would be: </p>
  
  <pre><code> AACATDOM: [AA/AA: 3, UA/AA: 1] 390.99
   11PUB2: [ UA/AA: 1, AS/AS: 4] 486.99
  
   myMap = [[name:AACATDOM, cost:390.99, carrierpair:AA/AA], [name:AACATDOM, cost:390.99, carrierpair:AA/AA], [name:AACATDOM, cost:395.99, carrierpair:UA/AA], [name:AACATDOM, cost:393.99, carrierpair:AA/AA], [name:AACATDOM, cost:393.99, carrierpair:AA/AA], [name:11PUB2, cost:486.99, carrierpair:UA/AA], [name:11PUB2, cost:486.99, carrierpair:UA/AA], [name:11PUB2, cost:892.99, carrierpair:AS/AS], [name:11PUB2, cost:892.99, carrierpair:AS/AS], [name:11PUB2, cost:892.99, carrierpair:AS/AS], [name:11PUB2, cost:892.99, carrierpair:AS/AS]]
  </code></pre>
  
  <p>A bit stumped on this one! Thanks in advance for any help!</p>