I have two arrays, each containing any number of hashes with identical keys but differing 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 having any number, the number of hashes will always be equal.
How could I find the largest :value_length
for every hash whose value is of a certain type?
For instance, the largest :value_length
for a hash with a :type
of 0 would be 4. The largest :value_length
for a hash with a :type
of 1 would be 8.
I just can't get my head around this problem.