Advertisement
Guest User

Untitled

a guest
Oct 13th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. var res = maxRatingBigrams.Min(s => s.Key);
  2.  
  3. var res = maxRatingBigrams.Min((x, y) => string.CompareOrdinal(x.Key, y.Key));
  4.  
  5. SortedDictionary<string, int> dict = new SortedDictionary<string, int>();
  6.  
  7. dict.Add("aaa", 5);
  8. dict.Add("bbb", 7);
  9. dict.Add("ccc", 8);
  10. dict.Add("ddd", 8);
  11. dict.Add("eee", 4);
  12. dict.Add("fff", 4);
  13.  
  14. int max = dict.Values.Max();
  15. string keyMax = "";
  16. foreach (string key in dict.Keys)
  17. {
  18. if (dict[key] == max)
  19. keyMax = key;
  20. }
  21.  
  22. Console.WriteLine(keyMax.ToString() + dict[keyMax]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement