I'm new to lambdas and they seemed fairly straight-forward until I tried to do something more complex. I have this dictionary.
Dictionary<int, int> dict = new Dictionary<int,int>();
of which I want to obtain the key of the key-val pair with the largest value. What I tried is:
dict.Keys.Max(g => dict[g])
The reasoning being that out of the list of Keys, pick that one for which dict[key] is largest. However, this picks the largest value itself, rather than its corresponding key.