title: Find the largest value for an array of hashes with common keys?
body: <p>I have two arrays, each containing any number of hashes with identical keys but differing values:</p>
  
  <pre><code>ArrayA = [{value: "abcd", value_length: 4, type: 0},{value: "abcdefgh", value_length: 8, type: 1}]
  ArrayB = [{value: "ab", value_length: 2, type: 0},{value: "abc", value_length: 3, type: 1}]
  </code></pre>
  
  <p>Despite having any number, the number of hashes will always be equal.</p>
  
  <p>How could I find the largest <code>:value_length</code> for every hash whose value is of a certain type?</p>
  
  <p>For instance, the largest <code>:value_length</code> for a hash with a <code>:type</code> of 0 would be 4. The largest <code>:value_length</code> for a hash with a <code>:type</code> of 1 would be 8.</p>
  
  <p>I just can't get my head around this problem.</p>