📜  如何找到最大值哈希的键? - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:36.137000             🧑  作者: Mango

代码示例1
# short version
hash.key(hash.values.max)

# longer more flexable version: 
puts hash.max_by(&:last).first

#without the .first you get the key and the value pair as array