Need some help with getting the key-value from a dictionary where the value is min.
Dictionary is str and int and looks like this:
{“a”, 2 : “b”, 1: “c”, 5}
How can I get “b” from the dict by finding that 1 is the min value?
or if the dictionary look like this:
{“a”, 2 : “b”, 5: “c”, 1 : “d”, 1}
How do I get the first key where on min vaule?
In this case “c”.
I come from python, so I might be thinking a bit much like how to do it there.
ex: min_key = min(my_dict, key=my_dict.get)
I guess you want the key where the value is minimum…
Then use as below
Dict.MinBy(function(x) x.Value).Key - gets the key related to minimum value Dict.Keys.Min - gets minimum key from the keys Dict.values.Min - gets the minimum value from the values