Get hash element with maximum value in clojure

How to find max element in clojure hashmap? Suppose you have the following hash file:

{:a 1 :b 3 :c 4 :d 18 :e 9} 

In this case, we need: d.

+4
source share
1 answer

I think this is your decision

 (key (apply max-key val {:a 1 :b 3 :c 4 :d 18 :e 9})) -> :d 
+12
source

All Articles