I have two arrays, each of which contains any number of hashes with the same keys, but with different values:
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}]
Despite any number, the number of hashes will always be equal.
How can I find the largest :value_length for each hash whose value is of a particular type?
For example, the largest :value_length for a hash with a :type of 0 will be 4. The largest :value_length for a hash with a :type of 1 will be 8.
I just can't solve this problem.
source share