I'm not sure if I understood your question correctly, but I assume that you have something like this:
my_hash = {1=>[2, 1, 3, 4], 2=>[1, 2], 3=>[1, 4, 6]}
If in this case you can get the key for the largest array, like this:
my_hash.max_by{|k,v| v.count}.first
source
share